easy_install on Cygwin: unittest2 causes SyntaxError - python

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)

Related

How do I install scipy and numpy with setuptools

I am developing a python 3.4 module which has scipy and numpy as dependencies. So I declared them in my setup.py under install_requires.
Here is the minimum running example of my setup.py
from setuptools import setup
setup(
name='MyModule',
version='1.0.5',
author='Alexander Mueller',
packages=[],
scripts=[],
license='LICENSE.txt',
description='Stuff',
install_requires=[
"pandas == 0.15.2",
"scikit-learn==0.17",
"seaborn == 0.5.1",
"scipy == 0.17.0",
"numpy==1.10.4"
]
)
While running python setup.py install the following exception occurs.
However, when I install all those packages in order with pip install, no error occurs at all. Might be easy_install the problem?
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 16, in <module>
"numpy==1.10.4"
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/install.py", line 117, in do_egg_install
cmd.run()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 380, in run
self.easy_install(spec, not self.no_deps)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 610, in easy_install
return self.install_item(None, spec, tmpdir, deps, True)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 661, in install_item
self.process_distribution(spec, dist, deps)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 709, in process_distribution
[requirement], self.local_index, self.easy_install
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 830, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1075, in best_match
return self.obtain(req, installer)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1087, in obtain
return installer(requirement)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 629, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 659, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 842, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1070, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 1056, in run_setup
run_setup(setup_script, args)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 240, in run_setup
raise
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/usr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 164, in save_modules
saved_exc.resume()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 139, in resume
compat.reraise(type, exc, self._tb)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/compat.py", line 65, in reraise
raise value.with_traceback(tb)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 152, in save_modules
yield saved
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 193, in setup_context
yield
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 237, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 267, in run
return func()
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 236, in runner
_execfile(setup_script, ns)
File "/Users/alexandermueller/.virtualenvs/fpm_test3/lib/python3.4/site-packages/setuptools/sandbox.py", line 46, in _execfile
exec(code, globals, locals)
File "/var/folders/b0/_y4bfk6x4bldrmtycxhmbtrm0000gn/T/easy_install-drrk1iwn/scipy-0.17.0/setup.py", line 265, in <module>
File "/var/folders/b0/_y4bfk6x4bldrmtycxhmbtrm0000gn/T/easy_install-drrk1iwn/scipy-0.17.0/setup.py", line 253, in setup_package
ImportError: No module named 'numpy'
Thank you guys in advance.
Order seems to matter here, with this order the required packages were installed
install_requires=[
"numpy == 1.10.4",
"pandas == 0.15.2",
"seaborn == 0.5.1",
"scipy == 0.17.0",
"scikit-learn == 0.17"
]
Tested with pip3 1.5.4, xubuntu 14.04

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.

how to install python pgmagick on windows

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.

pip install requirement fails

I am facing an issue while trying to install the requirements for my django project.
I am unable to figure out why I'm getting this error.
Can someone lead me in the right direction?
>Running setup.py egg_info for package django-staticfiles
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/glosseyvilly/Desktop/Workspace/chris_dev/mysite-env/build/django-staticfiles/setup.py", line 128, in <module>
'versiontools >= 1.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 260, in __init__
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 284, in fetch_build_eggs
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
plugin_projects = list(plugin_env)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 327, in fetch_build_egg
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 29, in <module>
in a distutils ``setup.py`` file.
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 354, in format_version
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 183, in from_tuple
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 126, in __new__
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 279, in _find_source_tree
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 936, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/Users/glosseyvilly/Desktop/Workspace/chris_dev/mysite-env/build/django-staticfiles/setup.py", line 128, in <module>
'versiontools >= 1.6',
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 260, in __init__
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 284, in fetch_build_eggs
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
plugin_projects = list(plugin_env)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/dist.py", line 327, in fetch_build_egg
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 29, in <module>
in a distutils ``setup.py`` file.
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 354, in format_version
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 183, in from_tuple
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 126, in __new__
File "/var/folders/zm/zmC41KkWH5ObUL0cyVjWL++++TI/-Tmp-/easy_install-wsSHXC/versiontools-1.8.1/versiontools/__init__.py", line 279, in _find_source_tree
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 936, in getouterframes
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 986, in prepare_files
req_to_install.run_egg_info()
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/req.py", line 222, in run_egg_info
command_desc='python setup.py egg_info')
File "/Library/Python/2.6/site-packages/pip-1.0.2-py2.6.egg/pip/__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
I ran into this same error while using the native Python 2.6.1 on Mac OS X 10.6 to install django-imagekit. Some googling revealed this:
https://github.com/jezdez/django_compressor/issues/181
which suggested this:
pip install versiontools
and then I was able to install django-imagekit.
Same issue when I try to install MySQL-python
apt-get install libmysqlclient-dev python-dev
solved my problem.
I think you need to install the python-dev version. Hope that helps
From this error
framelist.append((frame,) + getframeinfo(frame, context))
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 911, in getframeinfo
lines, lnum = findsource(frame)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/inspect.py", line 573, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
it appears that findsource(frame) is unable to find a legal lnum for frame. Are you sure that all the programs are aligned to known compatible versions (python, django, pip, etc)?
Before risking to pollute your system installation of python, I suggest that you use virtualenv to isolate the python environment from the one shipped with the OS.

Categories