I have copied my home folder from a Mac OSX 10.5 to a new Mac OSX 10.6. This broke east_intall for binary packages. For example if I use Python 2.5:
> easy_install celery
Searching for celery
Reading http://pypi.python.org/simple/celery/
Reading http://github.com/ask/celery/
Reading http://celeryproject.org
Best match: celery 2.2.7
Downloading http://pypi.python.org/packages/source/c/celery/celery-2.2.7.tar.gz#md5=5826cf891eaa6175cc7aab67818094fe
Processing celery-2.2.7.tar.gz
Running celery-2.2.7/setup.py -q bdist_egg --dist-dir /var/folders/TK/TKwwrl0JEyKrCVteN9D+Jk+++TI/-Tmp-/easy_install-RSjVZt/celery-2.2.7/egg-dist-tmp-w4bMT_
...
In file included from Modules/_multiprocessing/multiprocessing.h:6,
from Modules/_multiprocessing/multiprocessing.c:9:
/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:18:20: error: limits.h: No such file or directory
...
... millions of errors
...
error: Setup script exited with error: command 'gcc' failed with exit status 1
If I use Python 2.6
> easy_install-2.6 celery
Searching for celery
Reading http://pypi.python.org/simple/celery/
Reading http://github.com/ask/celery/
Reading http://celeryproject.org
Best match: celery 2.2.7
Downloading http://pypi.python.org/packages/source/c/celery/celery-2.2.7.tar.gz#md5=5826cf891eaa6175cc7aab67818094fe
Processing celery-2.2.7.tar.gz
Running celery-2.2.7/setup.py -q bdist_egg --dist-dir /var/folders/TK/TKwwrl0JEyKrCVteN9D+Jk+++TI/-Tmp-/easy_install-dCVly4/celery-2.2.7/egg-dist-tmp-PqOUyI
error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: Setup script exited with error: /var/folders/TK/TKwwrl0JEyKrCVteN9D+Jk+++TI/-Tmp-/easy_install-dCVly4/celery-2.2.7/temp/easy_install-61UKvH/PasteDeploy-1.5.0/temp/easy_install-ExR4d0/Paste-1.7.5.1/temp/easy_install-OJw80Y/PasteDeploy-1.5.0/temp/easy_install-Zg0wGJ/Paste-1.7.5.1/temp/easy_install-aWn8hm/PasteDeploy-1.5.0/temp/easy_install-1TOXq2/Paste-1.7.5.1/temp/easy_install-r97tJG/PasteDeploy-1.5.0/temp/easy_install-CNdClq/Paste-1.7.5.1/temp/easy_install-XUejp4/PasteDeploy-1.5.0/temp/easy_install-xN6Jd6/Paste-1.7.5.1/temp/easy_install-zFbJOI/PasteDeploy-1.5.0/temp/easy_install-fc2q_2/Paste-1.7.5.1/temp/easy_install-1rTVrG/PasteDeploy-1.5.0/temp/easy_install-rii66v/Paste-1.7.5.1/temp/easy_install-cZBf5J/PasteDeploy-1.5.0/temp/easy_install-ICPv8M/Paste-1.7.5.1/temp/easy_install-RwRQIz/PasteDeploy-1.5.0/temp/easy_install-x74lHT/Paste-1.7.5.1/temp/easy_install-Yf8l74/PasteDeploy-1.5.0/temp/easy_install-fnl5Wt/Paste-1.7.5.1/temp/easy_install-OwWNt9/PasteDeploy-1.5.0/temp/easy_install-WkOs3d/Paste-1.7.5.1/docs/include/reference_header.txt: File name too long
This is not a celery specific question. I get similar errors with lxml, matplotlib, scipy, etc. The problem occurs with all binary packages, not pure python packages. What am I doing wrong?
> which easy_install
/Library/Frameworks/Python.framework/Versions/Current/bin/easy_install
> which easy_install-2.6
/usr/bin/easy_install-2.6
It is difficult to tell for sure with the abbreviated tracebacks you included. One possibility is that the separate Python 2.5 you had installed on Mac OS X 10.5, most likely using a python.org installer, did not get copied over. If so, you either need to install a similar Python 2.5 there or move /Library/Frameworks/Python.frameworks from the old installation. Or you should update to using a newer Python, either a system one or one from python.org or one of the third-party open source distributors for Mac OS X, like MacPorts or homebrew or Fink or ActiveState.
Another possibility is that you need to install the optional MacOSX 10.4u SDK from the Xcode 3 installer for Mac OS X 10.6. If that is the case, you should be seeing error messages that include either 10.3 or 10.4 in them.
Update: So it seems you do have an easy_install installed for the extra python.org or at least for whatever version of Python is pointed to by /Library/Frameworks/Python.framework/Versions/Current. You seem to have to have two separate problems here (with the Python 2.5 and another with the system Python 2.6). At this point, it is difficult for me to guess what either of the problems is without getting a lot more information. It is probably best to clean up and start over.
If you want to remove the old Python 2.5 carried over from your old system, you can follow the instructions here on how to remove a python.org installed Python. If you want to, you can make a copy of it first or rename it instead with something like:
cd /Library/Frameworks/Python.framework/Versions
sudo mv 2.5 2.5-OLD
Consider doing the same for any other Python version there. DO NOT delete or modify any files in /System/Library/Frameworks or /usr/bin. Those directories are part of OS X.
Make sure you clean up your shell profile files, .bash_profile etc, to ensure that your PATH no longer includes this Python. Make you don't have any unexpected PYTHONPATH environment variables defined.
Make sure you don't have any outdated Distutils configurations files in your home directory. Look for and rename or remove things like .pydistutils.cfg.
cd ~
ls -al
Also make sure you don't have any unexpected private packages installed in local directories.
ls -al ~/Library/Python
ls -al ~/.local
Inspect and, if necessary, delete anything in the site-packages directories for the Apple-supplied Pythons:
cd /Library/Python/2.6/site-packages
ls -al
cd /Library/Python/2.5/site-packages
ls -al
Start a new terminal session and verify that all is well.
Decide what versions of Python you want to use with 10.6. If you are OK with using the Apple-suppled 2.6.1 or 2.5.4 versions, then use them. They both come with their own versions of easy_install in /usr/bin.
$ ls -l /usr/bin/python*
-rwxr-xr-x 2 root wheel 86000 Jun 24 2010 /usr/bin/python*
-rwxr-xr-x 5 root wheel 925 Jul 7 2009 /usr/bin/python-config*
lrwxr-xr-x 1 root wheel 75 Nov 7 2010 /usr/bin/python2.5# -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5
lrwxr-xr-x 1 root wheel 82 Nov 7 2010 /usr/bin/python2.5-config# -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5-config
lrwxr-xr-x 1 root wheel 75 Nov 7 2010 /usr/bin/python2.6# -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
lrwxr-xr-x 1 root wheel 82 Nov 7 2010 /usr/bin/python2.6-config# -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
-rwxr-xr-x 2 root wheel 86000 Jun 24 2010 /usr/bin/pythonw*
lrwxr-xr-x 1 root wheel 76 Nov 7 2010 /usr/bin/pythonw2.5# -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw2.5
lrwxr-xr-x 1 root wheel 76 Nov 7 2010 /usr/bin/pythonw2.6# -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
$ ls -l /usr/bin/easy*
-rwxr-xr-x 2 root wheel 925 Jun 30 2009 /usr/bin/easy_install*
-rwxr-xr-x 1 root wheel 421 Jun 30 2009 /usr/bin/easy_install-2.5*
-rwxr-xr-x 1 root wheel 421 Jun 30 2009 /usr/bin/easy_install-2.6*
If you want more recent and up-to-date versions of Python, consider installing the latest Pythons (Python 2.7.2 is the current version of Python 2) from python.org or homebrew, MacPorts, Fink, ActiveState etc. Update your shell PATH as necessary. (For example, the python.org installers by default modify your shell profiles appropriately.)
If the installation doesn't already come with an easy_install (python.org doesn't, some of the others have an optional package to do so), install the Distribute package which will provide an easy_install for it.
Have you installed XCode? It looks like you haven't.
Related
The first time I use pip install <new-package> it fails. Then I execute it again and it is successful. Why?
Details for the first attempt:
root#123:/usr/src# ls -lisa /usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info/METADATA
8791667 24 -rw-r--r-- 1 root staff 20704 Jan 22 16:26 /usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info/METADATA
root#123:/usr/src# pip install git+https://<url-to-some-package>
Collecting git+https://<url-to-some-package>
Cloning https://<url-to-some-package> to /tmp/pip-req-build-vk83727s
Building wheels for collected packages: <some-package>
Running setup.py bdist_wheel for <some-package> ... done
Stored in directory: /tmp/pip-ephem-wheel-cache-p03ffz3v/wheels/54/0f/ee/de883c215f26102bb3885860548be00ef83ce46a18d0007188
Successfully built <some-package>
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info/METADATA'
root#123:/usr/src# ls -lisa /usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info/METADATA
ls: cannot access '/usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info/METADATA': No such file or directory
root#123:/usr/src# ls -lisa /usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info
ls: cannot access '/usr/local/lib/python3.6/dist-packages/pytz-2018.9.dist-info': No such file or directory
root#123:/usr/src# ls -lisa /usr/local/lib/python3.6/dist-packages/
total 2048
9579135 8 drwxrwsr-x 1 root staff 4096 Jan 23 09:29 .
9579134 8 drwxrwsr-x 1 root staff 4096 May 9 2018 ..
<and-a-lot-more-packages>
These shell commands show that by executing pip install some files are REMOVED! This is quite confusing.
More info:
The new package is installed via git+https from a private git repository.
This output is from a Docker container but the issue happens outside docker as well.
The git repo of that new package is quite big (couple of hundreds of MB) even though the latest contents are quite small. This might point to a timeout or memory issue. But there are no hints in this respect in the output.
Environment: pip 19.0, Python 3.6.7, Ubuntu 18.04.1 LTS
I found the issue. The setup.py modules of the private modules were messing with pip (calling pip install). So I changed this and everything works now as expected.
Hy,
Sorry if this question was asked before, but I really couldnt find any helpful answer.
Running any python script in cygwin-terminal that uses modules that werent installed using cygwin-setup will just quit the python script without any output. Whats wrong?
Example:
import websocket
print "Done";
gives me a blank line and returns to the shell. Whereas
#import websocket
print "Done";
prints
Done
python scripts using i.e.
import hmac, base64, hashlib, urllib, urllib2, time, gzip, json, io, types, datetime, os
work fine.
I have:
-Cygwin64 on Win7-64bit using the mintty-terminal
-installed all python27 packages i found useful using setup.exe -> python is working
-i did run ez_setup.py under cygwin:
Installed /usr/lib/python2.7/site-packages/setuptools-2.1-py2.7.egg
Processing dependencies for setuptools==2.1
Finished processing dependencies for setuptools==2.1
-did run get-pip.py:
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages/pip-1.5-py2.7.egg
Cleaning up...
I have a copy of python27 on c:\python27 too. not using cygwin, but windows-cmd and using that python executable the above script works.
I need cygwin because i want to use curses and ansi codes etc but not use a virtual ubuntu or stuff.
I have:
$ ls -l python*
lrwxrwxrwx 1 Administrator None 13 18. Jan 11:12 python -> python2.7.exe
lrwxrwxrwx 1 Administrator None 13 18. Jan 11:12 python2 -> python2.7.exe
-rwxr-xr-x 1 Administrator None 7187 3. Okt 05:39 python2.7.exe
-rwxr-xr-x 1 Administrator None 1669 3. Okt 05:39 python2.7-config
lrwxrwxrwx 1 Administrator None 16 18. Jan 11:12 python2-config -> python2.7-config
lrwxrwxrwx 1 Administrator None 16 18. Jan 11:12 python-config -> python2.7-config
also running
pip
gives me a blank line and back comes the shell. whereas running pip in windows-cmd under c:\python27\scripts\ gives me:
Usage:
....
but running easy_install works:
$ easy_install
error: No urls, filenames, or requirements specified (see --help)
Thanks!
I had exactly the same problem. pip and pip2 run in the same way : no answer, even with only --version or --help option. pip3 does a core dump.
I found a hugly work around : remove cygwin64 and go back to cygwin.
If it could be helpful....
And it seems it has something to do with this issue https://github.com/pypa/pip/issues/1448
I'm new to Python development, and in trying to get Aptana Studio Setup, I seemed to have messed up my Python install. So I followed the uninstall MacPython instructions here http://homepages.cwi.nl/~jack/macpython/uninstall.html
...and now I'm trying to install Python again.
From what I can tell, GAE needs you to have Python 2.5. So I'm trying to install the 2.5.4 release from here: http://www.python.org/download/releases/2.5.4/ I've downloaded the dmg and when installing I get the following error:
The installation failed.
The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance
In fact, I've tried 2.5, 2.6 and 2.7 dmg installers for python, and I got the same exact error when installing all 3.
I'm running OS 10.6.8
Any ideas? Is there a better/different way to install Python on a Mac?
UPDATE:
When I open up my installer log, here are a few problems that I see:
I got a lot of these type of errors:
Sep 19 14:04:39 thething pkgExtractor[1689]: BomFatalError - cpio read error: bad file format
Sep 19 14:04:39 thething pkgExtractor[1689]: Package Authoring Error: Package "PythonSystemFixes-2.6.pkg" is using a deprecated archive format. Running in compatibility mode.
And at the end I got this:
Sep 19 14:04:40 thething Installer[1641]: run postflight script for Fix system Python
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: Could not find platform independent libraries <prefix>
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Sep 19 14:04:40 thething runner[1657]: postflight[1722]:
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: 'import site' failed; use -v for traceback
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: Traceback (most recent call last):
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: File "/Volumes/Python 2.6.6/Python.mpkg/Contents/Packages/PythonSystemFixes-2.6.pkg/Contents/Resources/postflight", line 16, in <module>
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: import os
Sep 19 14:04:40 thething runner[1657]: postflight[1722]: ImportError: No module named os
Sep 19 14:04:40 thething runner[1657]: postflight[1722]:
Sep 19 14:04:40 thething Installer[1641]: Install failed: The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance.
Sep 19 14:04:40 thething Installer[1641]: IFDInstallController 207240 state = 7
Sep 19 14:04:40 thething Installer[1641]: Displaying 'Install Failed' UI.
Sep 19 14:04:40 thething Installer[1641]: 'Install Failed' UI displayed message:'The following installation step failed: run postflight script for Fix system Python. Contact the software manufacturer for assistance.'.
OK, based on your information about /usr/bin/python failing (I was afraid that might be the case!), it appears there are problems with your Apple-supplied system Python. Perhaps you mistakenly deleted something in /System/Library/Frameworks/Python.frameworks, which is where the Apple-supplied Python resides and should never be modified or deleted, instead of /Library/Frameworks/Python.frameworks. Or perhaps you earlier followed the unfortunately misguided advice on the Python wiki here to create a symlink from /Library/Frameworks/Python.frameworks to the system Python framework which can result in an inadvertent corruption of the system Python when installing a new version of Python. The BOMFatalError message in the installer log is normal and can be ignored. Likewise, it is not a problem in itself that the Fix system Python package of the installer fails since it only applies to OS X 10.3. However, it is failing because the system Python is failing and that is a problem.
If you have a Time Machine backup or other backup of your System files, you may be able to properly (and carefully!) restore /System/Library/Python.frameworks/ from a backup. It is difficult but not impossible to extract the necessary files from a Snow Leopard OS X Installer DVD. If you have a similar machine running the same version of OS X, you might be able to copy the files from there. Or do a vanilla install of 10.6 to an unused disk partition. A simpler but imperfect workaround is to just create a symlink from /usr/bin/python and friends to the python.org Python and just wait until you reinstall Snow Leopard or upgrade to Lion (it might be safest to remove that symlink before upgrading). So something like this:
sudo bash
cd /usr/bin
mv python python-DISABLED
ln -s /usr/local/bin/python python
exit
You can develop using more recent Python, as long as you're not using post 2.5 language constructs or packages. (I'm using 2.6.5.)
Official support for Python 2.7 on the way.
I am new to linux (Ubuntu) and python (Django). By default there is python 2.6.6 in my linux, I installed python 2.7. In the command prompt when I type python it goes to python 2.6.6, I want to change my default python to 2.7.
Ubuntu might have a Python2.7 package. If so, install that then use that to create a virtualenv and put Django inside that.
I recommend to use pythonbrew which can install and switch between multi Python interpreters in your $HOME without touch your system directories.
BTW, when install python, use the command
pythonbrew install --no-test 2.7.2
to skip unitest could speed up the installation a lot.
It's all about the links, I tell ya. Look at the links. Check the inode's link count for python2.5, python2.6, python2.7, python3.2, etc. Notice those are greater than one.
Just hunt down the duped link to "python", fix by unlink, and relink it. It may be a real link, or just a sym link. unlink with extreme prejudice.
-rwxr-xr-x 2 root admin 12392 Oct 4 2009 /opt/local/bin/python2.5*
-rwxr-xr-x 2 root wheel 12392 Jul 23 17:14 /opt/local/bin/python2.6*
lrwxr-xr-x 1 root wheel 72 Nov 7 2008 /usr/bin/python# -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python
-rwxrwxr-x 1 root admin 41476 Jul 3 2010 /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7*
-rwxr-xr-x 3 root wheel 2072216 Jul 27 19:34 /usr/local/bin/python3.2*
The easiest way would be to modify your path and make sure the path to Python 2.7 is before Python 2.6. This is what I have done on my Mac to achieve similar things.
EDIT
I agree with Noufal Ibrahim in the fact about using virtualenv. I would also suggest looking into virutalenv wrapper. However, you still might have trouble using Python 2.7 is your path is not configured correctly, using an Ubuntu package for the install should take care of the path for you. Otherwise to install virtualenv from the bash shell, you can do something along the lines.
$ path/to/python27/python easy_install virutalenv
$ pip install virtualenvwrapper
I believe when installing virtualenv, it will set your PATH for you. You can confirm this by doing:
$which python
This should now show Python 2.7.
I am running Snow Leapord 10.6 and trying to install the following python modules:
numpy
scipy
matplotlib
I am running into problems because OSX contains two version of Python:
/Library/Python/
/System/Library/Frameworks/Python.framework/
It appears that when I execute the following command:
sudo easy_install -U {module}, the modules are being installed to the site-packages directory here:
bash-3.2$ ls -al /Library/Python/2.6/site-packages/
total 688
drwxrwxr-x 12 root admin 408 Aug 24 23:26 .
drwxrwxr-x 3 root admin 102 Feb 11 2010 ..
-rw-rw-r-- 1 root admin 119 Feb 11 2010 README
-rw-r--r-- 1 root admin 267 Aug 24 19:03 easy-install.pth
drwxr-xr-x 5 root admin 170 Aug 24 10:42 nose-0.11.4-py2.6.egg
drwxr-xr-x 38 root admin 1292 Aug 24 15:35 numpy
-rw-r--r-- 1 root admin 1618 Aug 24 15:35 numpy-2.0.0.dev8661-py2.6.egg-info
drwxr-xr-x 16 root admin 544 Aug 24 19:07 numscons
drwxr-xr-x 4 root admin 136 Aug 24 19:03 numscons-0.10.1-py2.6.egg
-rw-r--r-- 1 root admin 265 Aug 24 19:07 numscons-0.12.0dev-py2.6.egg-info
-rw-r--r-- 1 root admin 333959 Aug 23 11:51 setuptools-0.6c11-py2.6.egg
-rw-r--r-- 1 root admin 30 Aug 23 11:51 setuptools.pth
But, when I try to install scipy, I see the following error:
config = setup_module.configuration(*args)
File "scipy/setup.py", line 20, in configuration
config.add_subpackage('special')
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/distutils/misc_util.py", line 851, in add_subpackage
caller_level = 2)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/distutils/misc_util.py", line 834, in get_subpackage
caller_level = caller_level + 1)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/distutils/misc_util.py", line 766, in _get_configuration_from_setup_py
('.py', 'U', 1))
File "scipy/special/setup.py", line 14, in <module>
(numpy.__version__, numpy.__file__))
ValueError: numpy >= 1.4 is required (detected 1.2.1 from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy/__init__.pyc)
So it appears that it is looking for an older version of numpy in my frameworks directory. I used import to see which version of numpy python was finding:
python -c 'import numpy;print numpy.__version__'
1.2.1
And sure enough, it is looking in the frameworks directory even though I have a new version sitting in:
/Library/Python/2.6/site-packages/
I know import searches your local directory first, and then goes into PYTHONPATH, and then finally looks at sys.path. So I checked these out and I do not have PYTHONPATH set right now, and here is my sys.path:
/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg
/Library/Python/2.6/site-packages/numscons-0.10.1-py2.6.egg
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload
/Library/Python/2.6/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode
If I change PYTHONPATH to /Library/Python/2.6/site-packages and then check the numpy revision I get the correct version:
bash-3.2$ python -c 'import numpy; print numpy.__version__'
2.0.0.dev8661
But when I run sudo python setup.py build/install scipy cannot find the right numpy, even though PYTHONPATH has been set.
Can anyone please help me out here?
Found this link that looks like it fixes my problem, but I cant seem to get it to work:
http://andreasjacobsen.com/2008/10/10/using-python-setuptools-on-the-mac/
I think the easiest way would be to use MacPorts to install scipy. Here's an intro, though you probably want py26-scipy.
Have you tried installing with pip? Also, try installing scitools, which should pull those you needed.
The issue is that the easy_install you are calling is the one for the Apple install with the frameworks in /System and the python is /usr/bin/python
To see what python gets installed view the easy_install script and see what the #! line says which python to use.
To get the correct easy_install you will need to install distibute or setuptools for the python in /Library (I would guess this is a python.org one with /usr/local/bin/python ). Then use that easy_install
I would note however that I do use #boocs solution of using Macports althogh if just after scipy etc and no other C libraries then other solutions show here will work, also see Enthought
Can you not just move the old numpy out of the way, temporarily ?
cd /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
sudo mv numpy numpy-1.2.1 # mv back if need be
The solution I came up with is the following.
1) Do not use the version of Python that comes pre-installed with OSX. Apple has apparently made some modifications to this and not everything builds. So, you need to install a development version of Python. Right now - I would suggest installing Python 2.7. Here is a blog post about how to do it:
https://medium.com/cs-math/a3eb146ebfb5
2) Once you have installed Python, you need to install the fortran libraries for the Scipy/Numpy installation. Use homebrew to do that (Do people really still use MacPorts ???)
http://brew.sh/
3) After you have home brew installed, install fortran
brew install gfortran
4) Now you can install scipy/numpy successfully with pip (Warning - it takes a while)
pip install -U numpy
pip install -U scipy
DONE
I had kind of similar problem, just to same some time of the people with the same issue, if you have two pythons in your system (say python2 and python3) and you wish to install say numpy for the new version (python3) go through these steps:
1- download numpy
2-unzip it
3- in terminal go to the unzipped folder
4-python3 setup.py install