Missing gcc-4.0 error on pip install twisted in virtual env - twisted

I'm trying to use Scrapy inside a virtualenv, which requires installation of twisted as well. I did pip install Scrapy with no problems, but when I try pip install twisted, I'm getting the following error multiple times in the output:
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
I previously had a similar problem when trying to install python packages on my actual system, which is why I started using virtualenv in the first place. Is this an issue of the python version installed on my environment? This is what I currently have:
Django - 1.5 - active
Python - 2.7.3 - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
Scrapy - 0.16.4 - active
pip - 1.2.1 - active
setuptools - 0.6c11 - active
wsgiref - 0.1.2 - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
yolk - 0.4.3 - active
To check which version of gcc I have I typed gcc at the command line and got
i686-apple-darwin11-llvm-gcc-4.2: no input files
I tried export CC=gcc-4.2 before running pip install twisted, and I got:
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/s8/d0f65gc93nbchdk52g2cg5f80000gn/T//ccWQa7cJ.out
error: command 'gcc-4.2' failed with exit status 255
It sort of looks to me like it's looking for powerpc-apple-darwin11-llvm-gcc-4.2, and what I have above is i686-apple-darwin11-llvm-gcc-4.2--are these different and therefore causing the problem?
To give more background info, I installed Python 2.7 from a Python.org installer a long time ago before upgrading from Snow Leopard straight to Mountain Lion. If I simply type in python at the command line I get
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:32:06)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
So I'm guessing that means I'm using Apple's Python? And it's built with gcc-4.0.1? So if that's the case, shouldn't I not need to do the export CC=gcc-4.2? Or do I need to do that AND switch to the Python.org version of Python? (And if the latter, how do I do that?)
Update: I tried this solution for switching Python versions but it didn't work.
Update: I managed to switch Python versions (outside of my virtualenv) using the sudo port select --set python python27 command, but this didn't solve the problem even though I'm now showing:
Python 2.7.3 (default, Nov 17 2012, 19:54:34)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
when I type python at the commmand line.
Update: I also found this solution to a question that seemed to have almost the exact same issues as I'm having, but I'm already upgraded to XCode 4.6 and definitely have the Command Line Tools installed as described in the aforementioned solution (Preferences>Downloads tab>Install Command Line Tools). I do also have XCode 3.2.6 installed, however--any chance that's causing my problems?

Have you tried CC="$(type -p clang)" pip install twisted? You don't necessarily need to use gcc to compile Twisted's extensions; selecting clang instead might clear up whatever weird problem seems to be infesting your gcc installation.
If that doesn't work, I would suggest un-installing any Python.org versions of Python and then possibly re-installing both the OS and Xcode, since it looks like something might have corrupted your system Python install. I have no idea how references to powerpc stuff have persisted into Mountain Lion, since Lion removed support for ppc.

Related

Unable to install XGBOOST on MAC using Anaconda

I am using the Graphical Interface of Anaconda. I tried to install py-xgboost but it gave me the following error-
*UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
py-xgboost -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.*
It says I have python 3.8 installed in my system but when I checked the python version on my system using the command python2 --version & python3 --version it says I have python 2.7.16 & python 3.7.3
I dont have python 3.8
What shall I do now? The above python version were there already. I never installed and someone told me not to remove those versions as some of the MAC applications are dependent on them. Its a MAC BOOK PRO 15 ( 2019 )
After some research I found a solution. I had to downgrade my python version.
But as explained above when I tried to check the version of python I am using I was getting 2.7 & 3.7.3 but my ANACONDA gives an error that I have version 3.8
That was because Anaconda uses the python which is installed in a separate directory, it was not using the python installed at the PATH directory. So I had to downgrade python which the ANACONDA was using by using the command -
conda search python
BTW if your terminal says conda command not found, then you need to edit your PATH first.
Then it gives a list of python version, you can then see which version is right for your XGboost version and then use the command-
conda install python=3.7.7
or whatever version you wanted to use.
After the downgrade of python, anaconda will ask you to downgrade other libraries as well, so go ahead and do that too unless you are using some command which was not there in the older version.
Now install py-xgboost from ANACONDA Graphical interface or by using conda method
conda install -c anaconda py-xgboost

How to install lxml on Windows 8 64-bit with Python 3.4

Related Question 1
Related Question 2
[Error Log]
C:\Users\Hima\Documents\Installers\python\packages>python -m pip install lxml-3.4.4-cp34-none-win_amd64.whl
lxml-3.4.4-cp34-none-win_amd64.whl is not a supported wheel on this platform.
[Environment]
Windows x86 (64-bit)
Installed Visual Studio C++ 2014
Python 3.4
I use pip (or pip3.4.exe; built-in to Python 3.4) to pip install lxml
[Issues]
1. The lxml file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml shows as not supported.
2. In the following Package Index for lxml, there isn't a suitable lxml file for 64 bit and Python 3.4.
https://pypi.python.org/pypi/lxml/3.4.4
I have been struggling with this today. I found, elsewhere on stackoverflow.com, this two-part and quick solution, which resulted in python no longer complaining when I tried to use lxml:
Go to this repository and download a version which matches your Python installation (the version number, and 32- vs 64-bit. I use Python 3.5.1 64-bit, installed on Windows 10, so on that page, I chose lxml-3.6.0-cp35-cp35m-win_amd64.whl.
You say you use Python 3.4, so use a version that matches that (or maybe the one you already have).
There is some helpful information at the top of the page about which version of CPython the files are built against.
The output of python -v will also tell you which version of MSVC++ was used to build your version of the python executable.
This answer is useful for determining MSVC versions from the output of python -v (which contains a build number instead of a version number).
My download directory is d:\Downloads. Python must be in your PATH environment variable for the next step to work. Use a command like the following, changing "D:\Downloads" to the pathname to your download directory. Then, at a DOS prompt, type:
python -m pip install "D:\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl" lxml-3.6.0-cp35-cp35m-win_amd64.whl
My config:
Python 3.5
Windows 10
Downloaded lxml-3.6.0-cp35-cp35m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
Copy this file to: c:\Program Files\Python35\
first in cmd line:
c:\Program Files\Python35>py -m pip install --upgrade pip
Then in cmd line:
c:\Program Files\Python35>py -m pip install lxml-3.6.0-cp35-cp35m-win_amd64.whl
And it's done

installing numpy for pypy 2.3.5 (python 3.2.5 compatible) on windows 7 with mingw32

Here is mine small research about how-to install numpy for pypy3 on windows 7 with mingw32 compiler.
At first,tried to make it simple:
pypy setup.py install build --compiler=mingw32
But, here i got this error. Fortunately, i found this solution. Now, i'm trying again:
pypy setup.py install build --compiler=mingw32
And the error is:
data=DATA_RE.findall(nm_output)
TypeError:can't use a bytes pattern in string-like object
This error occurs in file pypy_numpy\numpy\distutils\lib2def.py.
So,the question is about how to handle this?

rvm install 1.9.3 on OS X 10.9.5 failing

Trying to install ruby 1.9.3 using rvm on Mac OSX 10.9.5. I've installed latest command line tools. I'm getting some weird errors with miniruby. I tried following other instructions to use clang but that didn't help:
$ rvm install 1.9.3 --with-gcc=clang
ruby-1.9.3-p547 - #removing src/ruby-1.9.3-p547..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: found user selected compiler 'clang', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/redact/.rvm/rubies/ruby-1.9.3-p547, this may take a while depending on your cpu(s)...
ruby-1.9.3-p547 - #downloading ruby-1.9.3-p547, this may take a while depending on your connection...
ruby-1.9.3-p547 - #extracting ruby-1.9.3-p547 to /Users/redact/.rvm/src/ruby-1.9.3-p547....
ruby-1.9.3-p547 - #applying patch /Users/redact/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p547 - #configuring...............................................
ruby-1.9.3-p547 - #post-configuration.
ruby-1.9.3-p547 - #compiling...........................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/redact/.rvm/log/1412548428_ruby-1.9.3-p547/make.log
-- Other runtime information -----------------------------------------------
* Loaded script: ./miniruby
* Loaded features:
0 enumerator.so
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
Took a lot of research and eventually found some hints to a solution here: https://github.com/wayneeseguin/rvm/issues/1975
I had to install a different version of gcc and run rvm using that:
brew install gcc46 # wait a long long time.
CC=$( find $( brew --prefix gcc46 ) -name gcc-4.6 -perm /u+x ) rvm install 1.9.3
Hope this helps someone.

Install Mono on Centos 5.5 using YUM

How do I install the Mono 2.6.7 runtime on CentOS 5.5 using YUM?
I know how to build Mono from the source. However, according to the page Getting Started With Mono Tools it is possible to install the binaries directly. I'd prefer to install the binaries to avoid having to install all the development pre-requisites on a server with little disk space.
Am I supposed to add a new repository description to YUM? I tried doing that, but I must have done it wrong, because "yum list mono-core" still says the old version (1.2.4-2.el5.centos).
And, why are the .rpm's called "mono-addon-" on the release server? It's a bit confusing. It sounds like the .rpm's are an add-on to Mono. I guess they mean they are an "add-on" to the server(?).
I figured it out.
Create a new repository configuration file
cd /etc/yum.repos.d
vi mono.repo
Add the following lines to the file
[Mono]
name=Mono Stack (RHEL_5)
type=rpm-md
baseurl=http://ftp.novell.com/pub/mono/download-stable/RHEL_5/
gpgcheck=1
gpgkey=http://ftp.novell.com/pub/mono/download-stable/RHEL_5/repodata/repomd.xml.key
enabled=1
Update the YUM cache to be on the safe side
yum clean all
Install the Mono server stack
yum install monotools-addon-server
The installed binaries will end up in "/opt/novell/mono/bin".
You should issue the following command to set up your shell environment so that it finds Mono, mcs and the other Mono tools
source /opt/novell/mono/bin/mono-addon-environment.sh
Verify the version
mono --version
Mono JIT compiler version 2.6.7 (tarball Mon Jul 19 18:28:58 UTC 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
GC: Included Boehm (with typed GC and Parallel Mark)
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
If you want the Mono environment to be permanent you can issue the following command.
cp /opt/novell/mono/bin/mono-addon-environment.sh /etc/profile.d
Happy Mono'ing!!!
In addition to octonion's post, if, like me, you want to use Apache mod_mono, you need to ensure you install the correct version of mod_mono by running the following, and it will get the right one:
yum install mod_mono-addon
Don't just issue yum install mod_mono. It may install mod_mono 1.2 version from the CentOS extras repository and not what you're actually after.
As a reference, I was getting the following error in /var/log/httpd/error_log when running the incorrect mod_mono version:
Root directory: /
mod_mono and xsp have different versions. Expected '9', got 6
System.InvalidOperationException: mod_mono and xsp have different versions. Expected '9', got 6
It is a silly, but easy mistake to make if you new to this like me.