I’m working on a recently-upgraded OS X Snow Leopard and MacPorts and I’m running into problems at every corner.
The first problem is the sheer number of installed Python versions: altogether, there are four:
2.5, 2.6 and 3.0 in /Library/Frameworks/Python.framework
2.6 in /opt/local/Library/Frameworks/Python.framework/ (MacPorts installation)
So there are at least two useless/redundant versions: 2.5 and the redundant 2.6.
Additionally, the pre-installed Python is giving me severe problems because some of the pre-installed libraries (in particular, scipy, numpy and matplotlib) don’t work properly.
I am sorely tempted to purge the complete /Library/Frameworks/Python.framework path, as well as the MacPorts Python installation. After that, I’ll start from a clean slate by installing a properly configured Python, e.g. that from Enthought.
Am I running headlong into trouble? Or is this a sane undertaking?
(In particular, I need a working Python in the next few days and if I end up with a non-working Python this would be a catastrophe of medium proportions. On the other hand, some features I need from matplotlib aren’t working now.)
Macports only installs into /opt/local (for python and related).
Apple's python uses /Library/Frameworks/Python.framework/2.x 2.5 from Leopard and 2.6 for Snow Leopard but just puts a site-packages install in there on install
Thus I think you can get rid of /Library/Frameworks/Python.framework
I would the use the macports python and install numpy etc through that as I find that the easiest way for installing packages that have C dependencies
Alternatives are to install python for python.org and install numpy etc from that
Related
This started with me trying to install the pandas-profiling library, which involves an update to SciPy. After this failed repeatedly due to wheel errors (more on this), I used SciPy to test what was going on, and found out this was failing to update, even when using "pip install -U SciPy"
Screenshots of errors below -- what is frustrating is that the log file it claims to generate in fact never is generated and there is not a folder or file where it claims to be and I have been through several iterations of tracking down, and in some cases having to create folders that were missing, updating 2017 build tools based on some of the errors that came up. That could be a whole other thread, but this is where it stands now when I try to update SciPy:
Screenshot of output part 1
Screenshot of output part 2
At this point I am immensely frustrated. What is the fix here? Will uninstalling all Python instances fix this? Or is there a deeper problem? I assumed the latter, but I have been installing things that seem to be missing and there's always something more. What the heck is going on? How can this be so screwed up on my machine and apparently unfixable?
Tried already:
pip install wheel
pip install meson
..and about a million iterations of installing other libraries or different flags on pip, no binary, update, etc. Python's not supposed to be this hard to set up, right? It wasn't before....
The issue looks like it's because you have 32 bit version of python installed and you are going from version 1.4.1 to 1.9.2.
SciPy v1.4.1 has a wheel (prebuilt binary) for 32 bit windows for python 3.8
SciPy v1.9.2 only has a wheel for 64bit windows python 3.8.
So when you installed it first (v1.4.1) everything was already compiled for you and it would have installed no problem.
As there is no wheel for v1.9.2 pip is attempting to build and compile everything from source (tar.gz file).
The SciPy docs say this is a nontrivial exercise but do provide steps https://scipy.github.io/devdocs/dev/contributor/building.html
You should be able to upgrade to v1.9.1 as this has wheel for python 3.8 32 bit.
I have Python 2.7.9 installed on Windows 7. When I try to install numpy package through pip or by downloading numpy.zip and running python setup.py install, I get various errors containing absence of various libraries. Is it possible to install numpy on Windows for 64-bit Python?
Have you tried these questions/answers?
https://stackoverflow.com/a/28947511/3412545
https://stackoverflow.com/a/4554296/3412545
Installing numpy, matplotlib on windows 7 64 bit
Otherwise, try another distribution link and report back the results here.
EDIT: Found good installation notes for posterity including plugin versions for python 2.7.9
https://code.google.com/p/pythonxy/wiki/StandardPlugins
I'm trying to install numpy 1.7 via an RPM on an older Linux machine with Python 2.4. The numpy release notes and the RPM page say it is supposed to be compatible with 2.4 (or <= 2.7), but when I try to install it on the machine with the command
rpm -i /tmp/python-numpy-1.7.0-2.1.i586.rpm
I get a number of missing dependency notes, including:
libc.so.6(GLIBC_2.11) is needed by python-numpy-1.7.0-2.1.i586
libc.so.6(GLIBC_2.4) is needed by python-numpy-1.7.0-2.1.i586
liblapack.so.3 is needed by python-numpy-1.7.0-2.1.i586
libpython2.7.so.1.0 is needed by python-numpy-1.7.0-2.1.i586
python >= 2.7 is needed by python-numpy-1.7.0-2.1.i586
python = 2.7 is needed by python-numpy-1.7.0-2.1.i586
python(abi) = 2.7 is needed by python-numpy-1.7.0-2.1.i586
rpmlib(PayloadIsLzma) <= 4.4.6-1 is needed by python-numpy-1.7.0-2.1.i586
So now at least Python 2.7 is needed, rather than up to 2.7. Is this a real discrepancy or am I using rpm incorrectly? I'm used to higher-level Linux package managers that report dependencies correctly and install them automatically, so I'm unsure how to proceed here.
Are you sure your distribution does not provide numpy already? It looks like numpy is part of epel.
If for some reason you are unwilling to use the version in the distribution, you're likely going to have to build the RPM yourself. I was able to build 1.7.1 on CentOS 5.7 like so:
sudo yum install rpm-build gcc python-devel
wget 'https://pypi.python.org/packages/source/n/numpy/numpy-1.7.1.tar.gz'
tar -xf numpy-1.7.1.tar.gz
cd numpy-1.7.1/
python setup.py bdist_rpm
sudo yum localinstall dist/numpy-1.7.1-1.i386.rpm
the generated RPM (in ./dist) should be useable without rebuilding on all of the machines with similar hardware and OS.
If all the machines have identical versions of Python, glibc, etc., then it would probably be easier to get the numpy source and build it yourself, assuming you have gcc (and perhaps gfortran) installed, along with dependencies like BLAS and LAPACK. Once it's installed on one machine, you can copy the numpy folder (and any .egg file) from /usr/lib/python2.4/site-packages (or whichever directory) and distribute that around the world. Make sure to create static libraries when you build so you don't need all the dependencies everywhere.
I'd also get numpy 1.7.1, as it fixes some issues with 1.7.0.
When I try to install numpy over a python.org python2.6 installation, I get these errors on my OS X terminal.
sh: gcc-4.2: command not found
And this causes failure. I noticed a pastebin (http://pastebin.com/hieSKe3A) already on this issue but I'm unable to find an answer online that works for Snow Leopard (there seem to be a lot of answers for Lion).
I noticed numpy requires the python.org python2.6 installation. I'm trying to do that. Btw, if there is a way for me to prevent the installer of the numpy mpkg from checking the python version available? (If yes, I may have another hacky way to do this.)
Help?
Thanks.
You have two main options to install gcc 4.2 on Snow Leopard:
Download pre-built binaries from osx-gcc-installer. This is the simplest way.
Download the Command Line Tools for Xcode package in the Developer Center and follow this guide to make it install on Snow Leopard.
In terminal type “gcc“, you will get message “command not found”.
C or GCC compiler is needed some times and MAC OS X does not have this installed by default
to install gcc compiler you will need to download and install command line tools for xcode (see Apples developer page)
What version of Python is needed to run Mercurial?
I see that the website says it requires 2.4. Does that mean 2.4, or 2.x? or something higher than 2.4, i.e., could I install 3.x?
I've installed Mercurial without reading the requirements and I installed it anyway and hg.exe executes fine.
Looking in the directory that hg.exe lives (C:\Program Files\Mercurial\), it has a python26.dll in there. Does that mean i won't have to install Python - i.e. it's bundled with Mercurial?
Thanks
Yes, it comes bundled. If you install Mercurial using the Windows installer, then you don't need to worry about which version of Python you are using. Mercurial uses py2exe to create an executable that runs without a Python installation.
Python 3.x is not compatible with 2.x.
If Mercurial supports 2.4 and above, then you are better off installing python 2.6.x.
Yes there are installers available that come bundled with python.
You run the following on command line and if you do not get any errors then you are on your way to use mercurial
> hg version
> hg debuginstall
> hg test_mercurial
> cd test_mercurial