how to install python pgmagick on windows - python

I m trying to install pgmagick library on windows. I m following the official page:
http://pypi.python.org/pypi/pgmagick/
From there i can notice that i need to install first easy_install,pip, boost and graphicsMagic.
In this page i found easy_install:
http://blog.troygrosfield.com/2010/12/18/installing-easy_install-and-pip-for-python/
In this page i can find pip and boost:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pgmagick
But i can't figure out how to install magick++. I went to website and download it but it installs just the software and when i try to install pgmagick like this:
pip install pgmagick
there is an error that i need magick++:
F:\Python27\Scripts>easy_install -ZU pgmagick
Searching for pgmagick
Reading http://pypi.python.org/simple/pgmagick/
Reading http://bitbucket.org/hhatto/pgmagick
Best match: pgmagick 0.5.4
Downloading http://pypi.python.org/packages/source/p/pgmagick/pgmagick-0.5.4.tar
.gz#md5=c10a454331ac1c359b39e50663fd28e4
Processing pgmagick-0.5.4.tar.gz
Running pgmagick-0.5.4\setup.py -q bdist_egg --dist-dir f:\docume~1\alessa~1\imp
ost~1\temp\easy_install-xaypdo\pgmagick-0.5.4\egg-dist-tmp-qu7mji
Traceback (most recent call last):
File "F:\Python27\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1712, in main
with_ei_usage(lambda:
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1700, in with_ei_usage
return f()
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "F:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "F:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "F:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
211, in run
self.easy_install(spec, not self.no_deps)
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
446, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
476, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
655, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
930, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "F:\Python27\lib\site-packages\setuptools\command\easy_install.py", line
919, in run_setup
run_setup(setup_script, args)
File "F:\Python27\lib\site-packages\setuptools\sandbox.py", line 62, in run_se
tup
lambda: execfile(
File "F:\Python27\lib\site-packages\setuptools\sandbox.py", line 105, in run
return func()
File "F:\Python27\lib\site-packages\setuptools\sandbox.py", line 64, in <lambd
a>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 74, in <module>
Exception: Magick++ not found
thanks!

I recommend you use the precompiled binary packages from the Unofficial Windows Binaries for Python Extension Packages (as mentioned in the pgmagick web page), instead of trying to compile from source which will be quite a complicated process.

Related

Error while installing Pillow on a Raspberry Pi

I just was trying to install yowsup on my new Raspberry Pi. Everything went fine, until it was about to install Pillow. I got the following error message:
Processing dependencies for yowsup2==2.4
Searching for pillow
Reading http://pypi.python.org/simple/pillow/
Best match: Pillow 3.0.0
Downloading https://pypi.python.org/packages/source/P/Pillow/Pillow-3.0.0.zip#md5=dd81f6cc3f3a5e5fe72f0f1d936339c3
Processing Pillow-3.0.0.zip
Running Pillow-3.0.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-AlZEzs/Pillow-3.0.0/egg-dist-tmp-rX2XN3
Exception in thread Thread-1 (most likely raised during interpreter shutdown):Exception in thread Thread-2 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_innerTraceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 505, in run File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
File "/usr/lib/python2.7/multiprocessing/pool.py", line 353, in _handle_tasks File "/usr/lib/python2.7/threading.py", line 505, in run
File "/usr/lib/python2.7/multiprocessing/pool.py", line 329, in _handle_workers
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Exception
TypeError<type 'exceptions.TypeError'>: 'NoneType' object is not callable
: TypeError("'NoneType' object does not support item deletion",) in <Finalize object, dead> ignored
Traceback (most recent call last):
File "setup.py", line 42, in <module>
'Topic :: Software Development :: Libraries :: Python Modules'
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 73, in run
self.do_egg_install()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 101, in do_egg_install
cmd.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 368, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 588, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 640, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 821, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 833, in obtain
return installer(requirement)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 30, in run_setup
lambda: execfile(
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 72, in run
return func()
File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 32, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 767, in <module>
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/bdist_egg.py", line 179, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/usr/lib/python2.7/dist-packages/setuptools/command/bdist_egg.py", line 166, in call_command
self.run_command(cmdname)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/setuptools/command/install_lib.py", line 20, in run
self.build()
File "/usr/lib/python2.7/distutils/command/install_lib.py", line 111, in build
self.run_command('build_ext')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "setup.py", line 515, in build_extensions
ValueError: --enable-jpeg requested but jpeg not found, aborting.
I googeled it for at least an hour, but couldn't find a correct answer. Do you have any suggestions for me?
So it looks like you're trying to install PIL without the proper packages installed beforehand. Try installing libjpeg.
sudo apt-get install libjpeg-dev
If you look at the External Libraries section of the Pillow docs, you'll see that there are a number of libraries that should be present, including libjpeg and zlib. If you don't want JPEG support, you should download the "source" archive from PyPI, unzip it, then in the resulting directory run python setup.py install --disable-jpeg.
However, I wouldn't recommend this, as you won't be able to process JPEGs with Pillow. Instead, use the package manager on your Pi to install all of the libraries for which you'd like support, then re-run pip install pillow.

Installing trepan debugger for Python 3 on Ubuntu 14.04

I am using Ubuntu 14.04 with Python version 2.7.6. I recently installed Python version 3.4.2 side-by-side with the system Python using pyenv. Now I would like to test out some debuggers for Python 3, and I downloaded trepan-0.2.8-py3.3.egg from the python3-trepan project page.
Then I ran pyenv global 3.4.2 and easy_install trepan-0.2.8-py3.3.egg, which gave me the following error:
Traceback (most recent call last):
File "/home/hakon/.pyenv/versions/3.4.2/bin/easy_install", line 11, in <module>
sys.exit(main())
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1909, in main
with_ei_usage(lambda:
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1896, in with_ei_usage
return f()
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1913, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 358, in run
self.easy_install(spec, not self.no_deps)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 574, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 625, in install_item
self.process_distribution(spec, dist, deps)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 671, in process_distribution
[requirement], self.local_index, self.easy_install
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/pkg_resources.py", line 564, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/pkg_resources.py", line 802, in best_match
return self.obtain(req, installer) # try and download/install
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/pkg_resources.py", line 814, in obtain
return installer(requirement)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 623, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1000, in run_setup
run_setup(setup_script, args)
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py", line 50, in run_setup
lambda: execfile(
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py", line 100, in run
return func()
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py", line 52, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "/home/hakon/.pyenv/versions/3.4.2/lib/python3.4/site-packages/setuptools/compat.py", line 78, in execfile
exec(compile(source, fn, 'exec'), globs, locs)
File "setup.py", line 12, in <module>
ImportError: No module named '__pkginfo__'
Update:
The problem seems not to be related to installing Python 3 using pyenv: I tried the following:
disabled pyenv
sudo apt-get install python3 python
sudo apt-get install python3-setuptools
sudo easy_install-3.4 trepan-0.2.8-py3.3.egg
This gave me the same error:
Traceback (most recent call last):
File "/usr/bin/easy_install-3.4", line 9, in <module>
load_entry_point('setuptools==3.3', 'console_scripts', 'easy_install-3.4')()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1963, in main
with_ei_usage(lambda:
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1950, in with_ei_usage
return f()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1967, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 381, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 597, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 648, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 694, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 620, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 858, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 870, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 616, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 646, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 834, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1040, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1025, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 50, in run_setup
lambda: execfile(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 100, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 52, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "/usr/lib/python3/dist-packages/setuptools/compat.py", line 78, in execfile
exec(compile(source, fn, 'exec'), globs, locs)
File "setup.py", line 12, in <module>
ImportError: No module named '__pkginfo__'
Starting with trepan 0.4.2 (at this writing we are at 0.4.7), the pip problems were addressed. However...
You are using pyenv but note that on Ubuntu 14.04 without that, you may need to use pip3 instead of pip. Outside of pyenv I think defaults pip to Python2's pip. See also this link.
And alas, there is another weirdness. When a wheel is not available (as was the case before version 0.4.7), pip uses the source tarball to install from rather than an egg. However the source code for Python 2 versus Python 3 is necessarily different and it would be too difficult to try to combine these into one source.
So, I have started to put wheel format file on pypi.org and I hope this too will address problems like this in the future.
I haven't tested it, but the maintainer #rocky recommends this to install:
pip3 install trepan3k
OLD:
Install using this command:
pip3 install -e git+https://github.com/rocky/python3-trepan/#egg=trepan
I think the current tarball/eggs are broken
You might take a look at https://askubuntu.com/questions/95037/what-is-the-best-way-to-install-python-packages or https://askubuntu.com/questions/350437/installing-python-modules-on-ubuntu or Installing python modules on Ubuntu
This just might solve the problem. Hope it helps.

easy_install on Cygwin: unittest2 causes SyntaxError

I'm trying to install unittest2 for Cygwin. I expect I'm missing something relatively simple, but I don't know what it is.
$ easy_install --version
distribute 0.6.34
$ python --version
Python 3.2.5
When I try to easy_install unittest2, I get the following output:
$ easy_install -U unittest2
Searching for unittest2
Reading http://pypi.python.org/simple/unittest2/
Best match: unittest2 0.5.1
Downloading https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.zip#md5=1527fb89e38343945af1166342d851ee
Processing unittest2-0.5.1.zip
Writing /tmp/easy_install-ncoq7f/unittest2-0.5.1/setup.cfg
Running unittest2-0.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ncoq7f/unittest2-0.5.1/egg-dist-tmp-ecnv6z
Traceback (most recent call last):
File "/usr/bin/easy_install", line 9, in <module>
load_entry_point('distribute==0.6.34', 'console_scripts', 'easy_install')()
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1937, in main
with_ei_usage(lambda:
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1918, in with_ei_usage
return f()
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1941, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
cmd_obj.run()
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 358, in run
self.easy_install(spec, not self.no_deps)
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 598, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 628, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 823, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1103, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3.2/site-packages/setuptools/command/easy_install.py", line 1089, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3.2/site-packages/setuptools/sandbox.py", line 34, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3.2/site-packages/setuptools/sandbox.py", line 82, in run
return func()
File "/usr/lib/python3.2/site-packages/setuptools/sandbox.py", line 37, in <lambda>
{'__file__':setup_script, '__name__':'__main__'})
File "setup.py", line 12, in <module>
File "/tmp/easy_install-ncoq7f/unittest2-0.5.1/unittest2/__init__.py", line 40, in <module>
File "/tmp/easy_install-ncoq7f/unittest2-0.5.1/unittest2/collector.py", line 3, in <module>
File "/tmp/easy_install-ncoq7f/unittest2-0.5.1/unittest2/loader.py", line 92
except Exception, e:
^
SyntaxError: invalid syntax
What's going on?
Try easy_install unittest2py3k (https://pypi.python.org/pypi/unittest2py3k). The error you are receiving is due to a change in syntax between in Python 3 (http://docs.pythonsprints.com/python3_porting/py-porting.html#exceptions)

TypeError: dist must be a Distribution instance

My package depends on BeautifulSoup. If I install my package in a fresh virtualenv via python setup.py develop, I get the following error. If I execute python setup.py develop a second time, everything seems to work fine. I have no idea, what's happening. How to fix it to get a reproducable setup?
Best match: beautifulsoup4 4.3.2
Downloading https://pypi.python.org/packages/source/b/beautifulsoup4/beautifulsoup4-4.3.2.tar.gz#md5=b8d157a204d56512a4cc196e53e7d8ee
Processing beautifulsoup4-4.3.2.tar.gz
Writing /tmp/easy_install-1eBfi3/beautifulsoup4-4.3.2/setup.cfg
Running beautifulsoup4-4.3.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1eBfi3/beautifulsoup4-4.3.2/egg-dist-tmp-YmoFSq
Traceback (most recent call last):
File "setup.py", line 73, in <module>
""",
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 27, in run
self.install_for_development()
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/develop.py", line 129, in install_for_development
self.process_distribution(None, self.dist, not self.no_deps)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 671, in process_distribution
[requirement], self.local_index, self.easy_install
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/pkg_resources.py", line 564, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/pkg_resources.py", line 802, in best_match
return self.obtain(req, installer) # try and download/install
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/pkg_resources.py", line 814, in obtain
return installer(requirement)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 593, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 623, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 809, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1015, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1000, in run_setup
run_setup(setup_script, args)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 50, in run_setup
lambda: execfile(
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 100, in run
return func()
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 52, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 27, in <module>
'raven',
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 970, in run_command
cmd_obj = self.get_command_obj(command)
File "/usr/lib/python2.7/distutils/dist.py", line 846, in get_command_obj
cmd_obj = self.command_obj[command] = klass(self)
File "/home/domma/VirtualEnvs/orcid/local/lib/python2.7/site-packages/setuptools/__init__.py", line 69, in __init__
_Command.__init__(self,dist)
File "/usr/lib/python2.7/distutils/cmd.py", line 59, in __init__
raise TypeError, "dist must be a Distribution instance"
TypeError: dist must be a Distribution instance
This error has to do with a discrepancy between the versions of distutils and setuptools installed on your machine. Upgrading setuptools to the current version is likely to resolve the issue.
EDIT: This solution no longer works for me (and apparently never worked for Jens -- see comment below). What now works for me is to import setuptools before anything else in whatever script I'm calling that leads to this error.
This error is discussed in many issues on GitHub, in many packages, but I find this discussion to be the most informative.
The only way I was able to solve it was to follow the https://bugs.python.org/file37554/distutils_accomodate_distribution_ducktypes.patch
So - I removed /usr/lib/python2.7/distutils/cmd.py and /usr/lib/python2.7/distutils/cmd.pyc ( ran a python setup.py develop - just to make sure it fails and is not using the pyc from somewhere else ) and then recreated /usr/lib/python2.7/distutils/cmd.py - only this time with the changes as shown in the patch. Then when I used python setup.py again - it worked..
install dnspython. pip install dnspython. Or check if u have older version of dnspython and upgrade
Try using pip for installing your package
$ pip install -e path/to/your/Project
See http://pip.readthedocs.org/en/latest/reference/pip_install.html#editable-installs for more information.
When I encountered this, it appeared at first glance that it was complaining that Distribution() didn't produce a Distribution instance, but that was only partly true.
setuptools provides its own Distribution, and monkeypatches it into distutils. That works in most cases, but will fail if you get a reference to Distribution before setuptools has been imported and done its magic.
The top of the script read:
from distutils.dist import Distribution
and then later we were importing and using various parts of setuptools.
The solution in my case was to do a late import in the function that uses it so Distribution was obtained after setuptools was loaded.

Python setup.py install throwing zipimport.ZipImportError

I run the following command in terminal sudo python2.6 setup.py install and after some output I get the below error.
Traceback (most recent call last):
File "setup.py", line 16, in <module>
packages=find_packages()
File "/opt/python2.6/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/opt/python2.6/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 76, in run
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py", line 104, in do_egg_install
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 211, in run
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 427, in easy_install
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 478, in install_item
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py", line 519, in process_distribution
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 570, in resolve
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2149, in requires
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2141, in _dep_map
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2560, in split_sections
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1854, in yield_lines
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2163, in _get_metadata
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1181, in get_metadata_lines
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1178, in get_metadata
File "/opt/python2.6/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1238, in _get
zipimport.ZipImportError: bad local file header in /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg
I ran the command unzip -t /opt/python2.6/lib/python2.6/site-packages/businesscommon-5.63-py2.6.egg to see if the EGG file is a valid ZIP file and it returned 'No errors detected'.
I've done some research on zipimport.ZipImportError but can't seem to figure how really to debug or fix it. I don't have much experience with Python so any help or advice would be appreciated.
Looks like all I needed to do was run sudo python2.5 setup.py install instead of sudo python2.6 setup.py install
Notice that I was oringally using python2.6 instead of python2.5.

Categories