Manually installing python packages - python

I have run into a problem while installing pychopg2 into my work computer (windows btw). Using pip wasn't an option, due to network restrictions, so I have learned how to install packages manually, and after some attempts, it seems to be working and installation runs without error:
running install
running bdist_egg
running egg_info
writing psycopg2.egg-info\PKG-INFO
writing dependency_links to psycopg2.egg-info\dependency_links.txt
writing top-level names to psycopg2.egg-info\top_level.txt
reading manifest file 'psycopg2.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'psycopg2.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\compat.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\errorcodes.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\errors.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\extensions.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\extras.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\pool.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\sql.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\tz.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\_ipaddress.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\_json.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\_lru_cache.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\_psycopg.cp37-win_amd64.pyd -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\_range.py -> build\bdist.win-amd64\egg\psycopg2
copying build\lib.win-amd64-3.7\psycopg2\__init__.py -> build\bdist.win-amd64\egg\psycopg2
byte-compiling build\bdist.win-amd64\egg\psycopg2\compat.py to compat.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\errorcodes.py to errorcodes.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\errors.py to errors.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\extensions.py to extensions.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\extras.py to extras.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\pool.py to pool.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\sql.py to sql.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\tz.py to tz.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\_ipaddress.py to _ipaddress.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\_json.py to _json.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\_lru_cache.py to _lru_cache.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\_range.py to _range.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\psycopg2\__init__.py to __init__.cpython-37.pyc
creating stub loader for psycopg2\_psycopg.cp37-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\psycopg2\_psycopg.py to _psycopg.cpython-37.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying psycopg2.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying psycopg2.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying psycopg2.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying psycopg2.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
psycopg2.__pycache__._psycopg.cpython-37: module references __file__
creating 'dist\psycopg2-2.8.4-py3.7-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing psycopg2-2.8.4-py3.7-win-amd64.egg
removing 'c:\users\user\anaconda\lib\site-packages\psycopg2-2.8.4-py3.7-win-amd64.egg' (and everything under it)
creating c:\users\user\anaconda\lib\site-packages\psycopg2-2.8.4-py3.7-win-amd64.egg
Extracting psycopg2-2.8.4-py3.7-win-amd64.egg to c:\users\user\anaconda\lib\site-packages
psycopg2 2.8.4 is already the active version in easy-install.pth
Installed c:\users\user\anaconda\lib\site-packages\psycopg2-2.8.4-py3.7-win-amd64.egg
Processing dependencies for psycopg2==2.8.4
Finished processing dependencies for psycopg2==2.8.4
But my code editor still complains about 'No module named psychopg2'. I am using anaconda3, added to path during installation. It seems that it could cause problems but I don't know if it is what is causing the package not to be recognized. Also, when I run python from cmd, it says:
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
But when I go to the folder where the environment is supposed to be, it is empty. So I tried to create one, and I get another network error. I'm getting out of ideas.

You are running the Anaconda interpreter without activating the environment.
Run conda activate env_name where env_name is the environment you created or base for the default environment. Then, install your package from within the environment using either conda (preferred) or pip and run Python while the environment is active.

Related

How to install lmfit package on Python3 on Windows 10

I try to install lmfit package on my Windows 10 computer. Because I could not install the package by typing: pip install lmfitI typed: python setup.py install. Then it shows:
running install
running bdist_egg
running egg_info
writing lmfit.egg-info\PKG-INFO
writing dependency_links to lmfit.egg-info\dependency_links.txt
writing requirements to lmfit.egg-info\requires.txt
writing top-level names to lmfit.egg-info\top_level.txt
reading manifest file 'lmfit.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.txt'
warning: no previously-included files found matching '*.pyc'
warning: no previously-included files found matching 'core.*'
warning: no previously-included files found matching '*~'
warning: no previously-included files found matching '*.pdf'
warning: no files found matching '*.dat' under directory 'tests'
warning: no previously-included files matching '*' found under directory 'doc\_build'
warning: no previously-included files matching '*.pdf' found under directory 'doc'
writing manifest file 'lmfit.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
UPDATING build\lib\lmfit/_version.py
set build\lib\lmfit/_version.py to '0.9.12'
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\confidence.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\jsonutils.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\lineshapes.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\minimizer.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\model.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\models.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\parameter.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\printfuncs.py -> build\bdist.win-amd64\egg\lmfit
creating build\bdist.win-amd64\egg\lmfit\ui
copying build\lib\lmfit\ui\basefitter.py -> build\bdist.win-amd64\egg\lmfit\ui
copying build\lib\lmfit\ui\ipy_fitter.py -> build\bdist.win-amd64\egg\lmfit\ui
copying build\lib\lmfit\ui\__init__.py -> build\bdist.win-amd64\egg\lmfit\ui
copying build\lib\lmfit\_ampgo.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\_version.py -> build\bdist.win-amd64\egg\lmfit
copying build\lib\lmfit\__init__.py -> build\bdist.win-amd64\egg\lmfit
byte-compiling build\bdist.win-amd64\egg\lmfit\confidence.py to confidence.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\jsonutils.py to jsonutils.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\lineshapes.py to lineshapes.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\minimizer.py to minimizer.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\model.py to model.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\models.py to models.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\parameter.py to parameter.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\printfuncs.py to printfuncs.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\ui\basefitter.py to basefitter.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\ui\ipy_fitter.py to ipy_fitter.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\ui\__init__.py to __init__.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\_ampgo.py to _ampgo.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\_version.py to _version.cpython-37.pyc
byte-compiling build\bdist.win-amd64\egg\lmfit\__init__.py to __init__.cpython-37.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying lmfit.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying lmfit.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying lmfit.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying lmfit.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying lmfit.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist\lmfit-0.9.12-py3.7.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing lmfit-0.9.12-py3.7.egg
Removing c:\users\re090\anaconda3\lib\site-packages\lmfit-0.9.12-py3.7.egg
Copying lmfit-0.9.12-py3.7.egg to c:\users\re090\anaconda3\lib\site-packages
lmfit 0.9.12 is already the active version in easy-install.pth
Installed c:\users\re090\anaconda3\lib\site-packages\lmfit-0.9.12-py3.7.egg
Processing dependencies for lmfit==0.9.12
Searching for uncertainties>=3.0
Reading https://pypi.org/simple/uncertainties/
Download error on https://pypi.org/simple/uncertainties/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'uncertainties' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.org/simple/
Download error on https://pypi.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or working download links found for uncertainties>=3.0
error: Could not find suitable distribution for Requirement.parse('uncertainties>=3.0')
This package actually runs well in other Windows 10 computer. But I got this error message on another newer Windows 10 computer. I'm wondering if it is the system's problem, which cannot be easily solved.
Do anybody know how to fix it?
Hm, not sure what the problem is -- it should work. The uncertainties dependency is spelled correctly and is available on PyPI. It is also available on conda channels conda-forge and gsecars. That is, either
pip install uncertainties
or
conda install -c gsecars uncertainties
or
conda install -c conda-forge uncertainties
should work.
But, to be clear pip install lmfit should also have worked. Any idea why that did not work?

Module python-twitter (github) giving error "No Module named cmdline" from shell

I've just installed the latest python twitter build ( https://github.com/bear/python-twitter ) and I'm receiving the below error. I get it when I try to use "twitter" from the shell...the "pip install python-twitter" worked fine, except it uses outdated api. This one seemed it might be updated, but throws the below error.
Error:
Traceback (most recent call last):
File "/usr/local/bin/twitter", line 9, in <module>
load_entry_point('twitter==1.12.1', 'console_scripts', 'twitter')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 353, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2302, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2029, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
ImportError: No module named cmdline
I'm having a hard time drilling down to what is causing this. Any thoughts?
In response to comments, I'm posting the output for each step, to see why the error remains:
1
pip uninstall twitter
response:
leo#production:~$ sudo pip uninstall twitter
Uninstalling twitter:
/usr/local/lib/python2.7/dist-packages/twitter-1.12.1-py2.7.egg
Proceed (y/n)? y
Successfully uninstalled twitter
2
sudo rm -rf /usr/lib/python2.7/site-packages/twitter-1.10.2-py2.7.egg
(silent)
3
wget https://pypi.python.org/packages/source/t/twitter/twitter-1.12.1.tar.gz
tar -xzf twitter*.tar.gz
cd twitter*
(successful)
3
sudo python setup.py build; sudo python setup.py install
Response:
p.py install
running build
running build_py
running egg_info
writing twitter.egg-info/PKG-INFO
writing top-level names to twitter.egg-info/top_level.txt
writing dependency_links to twitter.egg-info/dependency_links.txt
writing entry points to twitter.egg-info/entry_points.txt
reading manifest file 'twitter.egg-info/SOURCES.txt'
writing manifest file 'twitter.egg-info/SOURCES.txt'
running install
running bdist_egg
running egg_info
writing twitter.egg-info/PKG-INFO
writing top-level names to twitter.egg-info/top_level.txt
writing dependency_links to twitter.egg-info/dependency_links.txt
writing entry points to twitter.egg-info/entry_points.txt
reading manifest file 'twitter.egg-info/SOURCES.txt'
writing manifest file 'twitter.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/follow.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/api.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/twitter_globals.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/ansi.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/stream.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/ircbot.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/timezones.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/auth.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/archiver.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/stream_example.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/cmdline.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/util.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/logger.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/oauth2.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/oauth.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/__init__.py -> build/bdist.linux-x86_64/egg/twitter
copying build/lib.linux-x86_64-2.7/twitter/oauth_dance.py -> build/bdist.linux-x86_64/egg/twitter
byte-compiling build/bdist.linux-x86_64/egg/twitter/follow.py to follow.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/api.py to api.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/twitter_globals.py to twitter_globals.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/ansi.py to ansi.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/stream.py to stream.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/ircbot.py to ircbot.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/timezones.py to timezones.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/auth.py to auth.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/archiver.py to archiver.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/stream_example.py to stream_example.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/cmdline.py to cmdline.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/util.py to util.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/logger.py to logger.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/oauth2.py to oauth2.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/oauth.py to oauth.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/twitter/oauth_dance.py to oauth_dance.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying twitter.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying twitter.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying twitter.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying twitter.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying twitter.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying twitter.egg-info/zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/twitter-1.12.1-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing twitter-1.12.1-py2.7.egg
Copying twitter-1.12.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding twitter 1.12.1 to easy-install.pth file
Installing twitter-log script to /usr/local/bin
Installing twitter script to /usr/local/bin
Installing twitterbot script to /usr/local/bin
Installing twitter-follow script to /usr/local/bin
Installing twitter-stream-example script to /usr/local/bin
Installing twitter-archiver script to /usr/local/bin
Installed /usr/local/lib/python2.7/dist-packages/twitter-1.12.1-py2.7.egg
Processing dependencies for twitter==1.12.1
Finished processing dependencies for twitter==1.12.1
I got this error a while back. What I did is completely remove Python Twitter Tools with:
pip uninstall twitter
sudo rm -rf /usr/lib/python2.7/site-packages/twitter-1.10.2-py2.7.egg
Then I reinstalled it by using:
wget https://pypi.python.org/packages/source/t/twitter/twitter-1.12.1.tar.gz
tar -xzf twitter*.tar.gz
cd twitter*
sudo python setup.py build; sudo python setup.py install
Now it should work.
Found it! Thanks to #RydallCooper I was put on the proper trail :D
I had two packages apparently...
I had to uninstall them both:
pip uninstall twitter
and then:
pip uninstall python-twitter
Now the error is gone :D
(A few years on!) the solution may be to check the versions
E.g. if you're using a Python 3 shell, you may need to use pip3 install twitter rather than just pip install twitter

Cannot get pip module working in python 3.3

As I said, I am working in Python 3.3 and I was wondering if anyone can help me getting the pip module working.
When I look at the list of available modules using: help('modules'), the list contains "pip".
When I then try to "import pip" or "pip install 'module name'" (obviously w/o the quotes) I get error messages.
When I type "pip install beautifulsoup", I get:
pip install beautifulsoup
SyntaxError: invalid syntax.
When I try:
"import pip", I get:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import pip
File "E:\lib\site-packages\pip\__init__.py", line 9, in <module>
from pip.log import logger
File "E:\lib\site-packages\pip\log.py", line 7, in <module>
from pip import backwardcompat
File "E:\lib\site-packages\pip\backwardcompat\__init__.py", line 27, in <module>
console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'
If anyone can help with this it would be very appreciated. Good luck!
Used get-pip.py , which I installed successfully via the Windows cmd prompt, yet couldn't get the import working in the IDLE. Here's the complete log -:
C:\Python33\Lib>get-pip.py install
Downloading/unpacking pip
Downloading pip-1.3.1.tar.gz (247Kb): 247Kb downloaded
Running setup.py egg_info for package pip
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory
'docs\_build'
no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
Found existing installation: pip 1.3.1
Uninstalling pip:
Successfully uninstalled pip
Running setup.py install for pip
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory
'docs\_build'
no previously-included directories found matching 'docs\_build\_sources'
Installing pip-3.3-script.py script to C:\Python33\Scripts
Installing pip-3.3.exe script to C:\Python33\Scripts
Installing pip-script.py script to C:\Python33\Scripts
Installing pip.exe script to C:\Python33\Scripts
Successfully installed pip
Cleaning up...
C:\Python33\Lib>cd pip-1.3.1
C:\Python33\Lib\pip-1.3.1>cd pip-1.3.1
C:\Python33\Lib\pip-1.3.1\pip-1.3.1>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.
C:\Python33\Lib\pip-1.3.1\pip-1.3.1>cd ..
C:\Python33\Lib\pip-1.3.1>cd..
C:\Python33\Lib>pip install beautifulsoup4
'pip' is not recognized as an internal or external command,
operable program or batch file.
C:\Python33\Lib>python3-pip RPM
'python3-pip' is not recognized as an internal or external command,
operable program or batch file.
C:\Python33\Lib>cd pip-1.3.1
C:\Python33\Lib\pip-1.3.1>cd pip-1.3.1
C:\Python33\Lib\pip-1.3.1\pip-1.3.1>get-pip.py install
Downloading/unpacking pip
Downloading pip-1.3.1.tar.gz (247Kb): 247Kb downloaded
Running setup.py egg_info for package pip
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory
'docs\_build'
no previously-included directories found matching 'docs\_build\_sources'
Installing collected packages: pip
Found existing installation: pip 1.3.1
Uninstalling pip:
Successfully uninstalled pip
Running setup.py install for pip
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory
'docs\_build'
no previously-included directories found matching 'docs\_build\_sources'
Installing pip-3.3-script.py script to C:\Python33\Scripts
Installing pip-3.3.exe script to C:\Python33\Scripts
Installing pip-script.py script to C:\Python33\Scripts
Installing pip.exe script to C:\Python33\Scripts
Successfully installed pip
Cleaning up...
C:\Python33\Lib\pip-1.3.1\pip-1.3.1>sudo easy_install pandas
'sudo' is not recognized as an internal or external command,
operable program or batch file.
C:\Python33\Lib\pip-1.3.1\pip-1.3.1>setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to pip.egg-info\dependency_links.txt
writing top-level names to pip.egg-info\top_level.txt
writing pip.egg-info\PKG-INFO
writing requirements to pip.egg-info\requires.txt
writing entry points to pip.egg-info\entry_points.txt
reading manifest file 'pip.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'do
cs\_build'
no previously-included directories found matching 'docs\_build\_sources'
writing manifest file 'pip.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\pip
creating build\bdist.win-amd64\egg\pip\backwardcompat
copying build\lib\pip\backwardcompat\socket_create_connection.py -> build\bdist.
win-amd64\egg\pip\backwardcompat
copying build\lib\pip\backwardcompat\ssl_match_hostname.py -> build\bdist.win-am
d64\egg\pip\backwardcompat
copying build\lib\pip\backwardcompat\__init__.py -> build\bdist.win-amd64\egg\pi
p\backwardcompat
copying build\lib\pip\basecommand.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\baseparser.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\cacert.pem -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\cmdoptions.py -> build\bdist.win-amd64\egg\pip
creating build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\bundle.py -> build\bdist.win-amd64\egg\pip\comman
ds
copying build\lib\pip\commands\completion.py -> build\bdist.win-amd64\egg\pip\co
mmands
copying build\lib\pip\commands\freeze.py -> build\bdist.win-amd64\egg\pip\comman
ds
copying build\lib\pip\commands\help.py -> build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\install.py -> build\bdist.win-amd64\egg\pip\comma
nds
copying build\lib\pip\commands\list.py -> build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\search.py -> build\bdist.win-amd64\egg\pip\comman
ds
copying build\lib\pip\commands\show.py -> build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\uninstall.py -> build\bdist.win-amd64\egg\pip\com
mands
copying build\lib\pip\commands\unzip.py -> build\bdist.win-amd64\egg\pip\command
s
copying build\lib\pip\commands\zip.py -> build\bdist.win-amd64\egg\pip\commands
copying build\lib\pip\commands\__init__.py -> build\bdist.win-amd64\egg\pip\comm
ands
copying build\lib\pip\download.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\exceptions.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\index.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\locations.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\log.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\req.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\runner.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\status_codes.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\util.py -> build\bdist.win-amd64\egg\pip
creating build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\bazaar.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\git.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\mercurial.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\subversion.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\vcs\__init__.py -> build\bdist.win-amd64\egg\pip\vcs
copying build\lib\pip\__init__.py -> build\bdist.win-amd64\egg\pip
copying build\lib\pip\__main__.py -> build\bdist.win-amd64\egg\pip
byte-compiling build\bdist.win-amd64\egg\pip\backwardcompat\socket_create_connec
tion.py to socket_create_connection.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\backwardcompat\ssl_match_hostname.p
y to ssl_match_hostname.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\backwardcompat\__init__.py to __ini
t__.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\basecommand.py to basecommand.cpyth
on-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\baseparser.py to baseparser.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\cmdoptions.py to cmdoptions.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\bundle.py to bundle.cpytho
n-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\completion.py to completio
n.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\freeze.py to freeze.cpytho
n-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\help.py to help.cpython-33
.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\install.py to install.cpyt
hon-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\list.py to list.cpython-33
.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\search.py to search.cpytho
n-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\show.py to show.cpython-33
.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\uninstall.py to uninstall.
cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\unzip.py to unzip.cpython-
33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\commands\zip.py to zip.cpython-33.p
yc
byte-compiling build\bdist.win-amd64\egg\pip\commands\__init__.py to __init__.cp
ython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\download.py to download.cpython-33.
pyc
byte-compiling build\bdist.win-amd64\egg\pip\exceptions.py to exceptions.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\index.py to index.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\locations.py to locations.cpython-3
3.pyc
byte-compiling build\bdist.win-amd64\egg\pip\log.py to log.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\req.py to req.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\runner.py to runner.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\status_codes.py to status_codes.cpy
thon-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\util.py to util.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\bazaar.py to bazaar.cpython-33.
pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\git.py to git.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\mercurial.py to mercurial.cpyth
on-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\subversion.py to subversion.cpy
thon-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\vcs\__init__.py to __init__.cpython
-33.pyc
byte-compiling build\bdist.win-amd64\egg\pip\__init__.py to __init__.cpython-33.
pyc
byte-compiling build\bdist.win-amd64\egg\pip\__main__.py to __main__.cpython-33.
pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\not-zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying pip.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
creating 'dist\pip-1.3.1-py3.3.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing pip-1.3.1-py3.3.egg
creating c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg
Extracting pip-1.3.1-py3.3.egg to c:\python33\lib\site-packages
Adding pip 1.3.1 to easy-install.pth file
Installing pip-3.3-script.py script to C:\Python33\Scripts
Installing pip-3.3.exe script to C:\Python33\Scripts
Installing pip-script.py script to C:\Python33\Scripts
Installing pip.exe script to C:\Python33\Scripts
Installed c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg
Processing dependencies for pip==1.3.1
Finished processing dependencies for pip==1.3.1
import pip in IDLE [I am with Python 3.3.0]
>
import pip
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
import pip
File "C:\Python33\lib\site-packages\pip\__init__.py", line 9, in <module>
from pip.log import logger
File "C:\Python33\lib\site-packages\pip\log.py", line 7, in <module>
from pip import backwardcompat
File "C:\Python33\lib\site-packages\pip\backwardcompat\__init__.py", line 27, in <module>
console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'

Error installing MySQL-python on MAC Snow Leopard, OS 10.6

I am trying to install the MySQL-python on MAC OS 10.6 (Snow leopard, 64 bit). I followed the steps:
1. Installed MySQL for Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive.
2. Downloaded MySQL-python-1.2.3c1.tar.gz and unzipped it
3. CD to MySQL-python-1.2.3c1 and built it as:
ARCHFLAGS="-arch x86_64" python setup.py build (see output bnelow)
4. Installed it as:
ARCHFLAGS="-arch x86_64" python setup.py install
5. But when I tried to import MySQLdb to python, I am getting error message
import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.3-x86_64/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.3-x86_64/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.3-x86_64/egg/_mysql.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/krokodil/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg-tmp/_mysql.so, 2): no suitable image found. Did find:
/Users/krokodil/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg-tmp/_mysql.so: mach-o, but wrong architecture
This "macosx-10.3-x86_64" is bothering me - it seems that somehow the build/install thought that I am still on Mac OS 10.3. Please also see Build and Install capture below.
It also using /Developer/SDKs/MacOSX10.4u.sdk compiler, not /Developer/SDKs/MacOSX10.6.sdk
I am using fresh install of Python 2.6.4.
I saw people having probles. Anyone found a good solution?
Thank you
Vlad
BUILD
krokodil:MySQL-python-1.2.3c1 krokodil$ ARCHFLAGS="-arch x86_64" python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.3-x86_64-2.6
copying _mysql_exceptions.py -> build/lib.macosx-10.3-x86_64-2.6
creating build/lib.macosx-10.3-x86_64-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
creating build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.3-x86_64-2.6
gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.3-x86_64-2.6/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
In file included from _mysql.c:36:
/usr/local/mysql/include/my_config.h:1053:1: warning: "HAVE_WCSCOLL" redefined
In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:8,
from pymemcompat.h:10,
from _mysql.c:29:
/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyconfig.h:805:1: warning: this is the location of the previous definition
gcc-4.0 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup -arch x86_64 build/temp.macosx-10.3-x86_64-2.6/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc -o build/lib.macosx-10.3-x86_64-2.6/_mysql.so
INSTALL
krokodil:MySQL-python-1.2.3c1 krokodil$ ARCHFLAGS="-arch x86_64" python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.3-x86_64/egg
running install_lib
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-x86_64-2.6/MySQLdb
running build_ext
creating build/bdist.macosx-10.3-x86_64
creating build/bdist.macosx-10.3-x86_64/egg
copying build/lib.macosx-10.3-x86_64-2.6/_mysql.so -> build/bdist.macosx-10.3-x86_64/egg
copying build/lib.macosx-10.3-x86_64-2.6/_mysql_exceptions.py -> build/bdist.macosx-10.3-x86_64/egg
creating build/bdist.macosx-10.3-x86_64/egg/MySQLdb
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/__init__.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/connections.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb
creating build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/__init__.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/CLIENT.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/CR.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/ER.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/FIELD_TYPE.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/FLAG.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/constants/REFRESH.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/converters.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/cursors.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/release.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb
copying build/lib.macosx-10.3-x86_64-2.6/MySQLdb/times.py -> build/bdist.macosx-10.3-x86_64/egg/MySQLdb
byte-compiling build/bdist.macosx-10.3-x86_64/egg/_mysql_exceptions.py to _mysql_exceptions.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/connections.py to connections.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/CLIENT.py to CLIENT.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/CR.py to CR.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/ER.py to ER.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/FIELD_TYPE.py to FIELD_TYPE.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/FLAG.py to FLAG.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/constants/REFRESH.py to REFRESH.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/converters.py to converters.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/cursors.py to cursors.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/release.py to release.pyc
byte-compiling build/bdist.macosx-10.3-x86_64/egg/MySQLdb/times.py to times.pyc
creating stub loader for _mysql.so
byte-compiling build/bdist.macosx-10.3-x86_64/egg/_mysql.py to _mysql.pyc
creating build/bdist.macosx-10.3-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/PKG-INFO -> build/bdist.macosx-10.3-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-x86_64/egg/EGG-INFO
copying MySQL_python.egg-info/top_level.txt -> build/bdist.macosx-10.3-x86_64/egg/EGG-INFO
writing build/bdist.macosx-10.3-x86_64/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg' and adding 'build/bdist.macosx-10.3-x86_64/egg' to it
removing 'build/bdist.macosx-10.3-x86_64/egg' (and everything under it)
Processing MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg
Removing /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg
Copying MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg to /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
Removing MySQL-python 1.2.3c1 from easy-install.pth file
Adding MySQL-python 1.2.3c1 to easy-install.pth file
Installed /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-macosx-10.3-x86_64.egg
Processing dependencies for MySQL-python==1.2.3c1
Finished processing dependencies for MySQL-python==1.2.3c1
The python 2.6.4 you are using is 32-bit only (definitely true if you downloaded the OS X installer from python.org). You can't override the architecture for extension modules; they have to be compatible with the base python. The 10.3 shows up because the python you are using was built with a deployment target of 10.3 as it is designed to run on multiple versions of OS X. If you want to use a 64-bit version of MySQL, you'll need to use a 64-bit version of python, like the Apple-suppled python 2.6.1.

Python MySQL installing wrongly on Mac OS X 10.6 i386

When trying to install MySQL's python bindings, MySQLdb, I followed the instructions to build and install on my MacBook running Mac OS X 10.6 i386, and after entering the following line into the terminal:
user-152-3-158-79:MySQL-python-1.2.3c1 jianweigan$ sudo python setup.py build
I get the following errors:
running build
running build_py
creating build/lib.macosx-10.3-i386-2.6
copying _mysql_exceptions.py -> build/lib.macosx-10.3-i386-2.6
creating build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
creating build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.3-i386-2.6
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation
It looks like the setup.py build script is recognizing my OS as Mac OS X 10.3 instead of 10.6 so it tries to locate an older version of XCode which I don't have.
Does anyone know how to get around this problem? Perhaps manually configuring the script to recognize my os as 10.6?
It appears you have installed and are using a python.org python2.6. Because that installer is designed to work for a range of systems, to build extensions with that python on 10.6, you need to install the optional 10.4 SDK which is part of the Xcode package on the Snow Leopard installation DVD or machine restore DVD; the 10.4 SDK is not installed by default. That's what the message is trying to tell you.
Installing the latest version of Python from python.org, fixed this problem for me.
Well the error is pretty clear, do you have xcode installed? http://developer.apple.com/tools/Xcode/
You can look at a more detailed solution to this in http://blog.some-abstract-type.com/2009/09/mysql-python-and-mac-os-x-106-snow.html which includes downloading the latest xcode. Hope it helps.

Categories