Unable to install many of the new python modules using python3
mecworks opened this issue · 3 comments
I am using Ubuntu 16.04LTS on a desktop computer with both python2.7 and python3.5 installed. All packages installed correctly using python 2.7 however, when installing using python 3 (pip3), I get the following error for many of the packages as I try to install them. This one is the error for the mcp3008 module but all are the same error.
Collecting adafruit-mcp3008
Downloading Adafruit_MCP3008-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
Extracting in /tmp/tmpd5gowb59
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-dr4m3nxh/adafruit-mcp3008/setup.py", line 2, in <module>
use_setuptools()
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 125, in _do_download
_build_egg(egg, tarball, to_dir)
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 99, in _build_egg
_extractall(tar)
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 467, in _extractall
self.chown(tarinfo, dirpath)
TypeError: chown() missing 1 required positional argument: 'numeric_owner'
I edited /usr/local/lib/python3.5/dist-packages/ez_setup.py, line 467 and added an empty parameter to satisfy the above error and got further but then ended up with the following:
Collecting adafruit-mcp3008
Downloading Adafruit_MCP3008-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
Extracting in /tmp/tmprw17in6r
Now working in /tmp/tmprw17in6r/distribute-0.6.14
Building a Distribute egg in /tmp/pip-build-tz5sq5vx/adafruit-mcp3008
creating build
creating build/src
creating build/src/docs
creating build/src/docs/_templates
creating build/src/docs/_theme
creating build/src/docs/_theme/nature
creating build/src/docs/_theme/nature/static
creating build/src/docs/build
creating build/src/docs/build/html
creating build/src/docs/build/html/_sources
creating build/src/docs/build/html/_static
creating build/src/setuptools
creating build/src/setuptools/command
creating build/src/setuptools/tests
creating build/src/setuptools/tests/indexes
creating build/src/setuptools/tests/indexes/test_links_priority
creating build/src/setuptools/tests/indexes/test_links_priority/simple
creating build/src/setuptools/tests/indexes/test_links_priority/simple/foobar
creating build/src/tests
creating build/src/tests/shlib_test
copying setuptools/__init__.py -> build/src/setuptools
copying setuptools/sandbox.py -> build/src/setuptools
copying setuptools/depends.py -> build/src/setuptools
copying setuptools/extension.py -> build/src/setuptools
copying setuptools/dist.py -> build/src/setuptools
copying setuptools/package_index.py -> build/src/setuptools
copying setuptools/archive_util.py -> build/src/setuptools
copying setuptools/command/install_scripts.py -> build/src/setuptools/command
copying setuptools/command/__init__.py -> build/src/setuptools/command
copying setuptools/command/bdist_wininst.py -> build/src/setuptools/command
copying setuptools/command/upload.py -> build/src/setuptools/command
copying setuptools/command/install.py -> build/src/setuptools/command
copying setuptools/command/build_py.py -> build/src/setuptools/command
copying setuptools/command/install_lib.py -> build/src/setuptools/command
copying setuptools/command/install_egg_info.py -> build/src/setuptools/command
copying setuptools/command/sdist.py -> build/src/setuptools/command
copying setuptools/command/upload_docs.py -> build/src/setuptools/command
copying setuptools/command/bdist_rpm.py -> build/src/setuptools/command
copying setuptools/command/develop.py -> build/src/setuptools/command
copying setuptools/command/test.py -> build/src/setuptools/command
copying setuptools/command/easy_install.py -> build/src/setuptools/command
copying setuptools/command/alias.py -> build/src/setuptools/command
copying setuptools/command/bdist_egg.py -> build/src/setuptools/command
copying setuptools/command/build_ext.py -> build/src/setuptools/command
copying setuptools/command/rotate.py -> build/src/setuptools/command
copying setuptools/command/register.py -> build/src/setuptools/command
copying setuptools/command/setopt.py -> build/src/setuptools/command
copying setuptools/command/saveopts.py -> build/src/setuptools/command
copying setuptools/command/egg_info.py -> build/src/setuptools/command
copying setuptools/tests/__init__.py -> build/src/setuptools/tests
copying setuptools/tests/test_develop.py -> build/src/setuptools/tests
copying setuptools/tests/test_easy_install.py -> build/src/setuptools/tests
copying setuptools/tests/test_upload_docs.py -> build/src/setuptools/tests
copying setuptools/tests/doctest.py -> build/src/setuptools/tests
copying setuptools/tests/test_build_ext.py -> build/src/setuptools/tests
copying setuptools/tests/test_packageindex.py -> build/src/setuptools/tests
copying setuptools/tests/test_resources.py -> build/src/setuptools/tests
copying setuptools/tests/test_sandbox.py -> build/src/setuptools/tests
copying setuptools/tests/server.py -> build/src/setuptools/tests
copying setuptools/tests/win_script_wrapper.txt -> build/src/setuptools/tests
copying setuptools/gui.exe -> build/src/setuptools
copying setuptools/cli.exe -> build/src/setuptools
copying tests/test_distribute_setup.py -> build/src/tests
copying tests/install_test.py -> build/src/tests
copying tests/manual_test.py -> build/src/tests
copying tests/shlib_test/test_hello.py -> build/src/tests/shlib_test
copying tests/shlib_test/setup.py -> build/src/tests/shlib_test
copying tests/shlib_test/hellolib.c -> build/src/tests/shlib_test
copying tests/shlib_test/hello.c -> build/src/tests/shlib_test
copying tests/shlib_test/hello.pyx -> build/src/tests/shlib_test
copying tests/api_tests.txt -> build/src/tests
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: buffer
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: idioms
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: set_literal
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Skipping optional fixer: ws_comma
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
RefactoringTool: Refactored build/src/tests/api_tests.txt
RefactoringTool: Files that were modified:
RefactoringTool: build/src/tests/api_tests.txt
--- build/src/tests/api_tests.txt (original)
+++ build/src/tests/api_tests.txt (refactored)
@@ -39,7 +39,7 @@
>>> dist.py_version == sys.version[:3]
True
- >>> print dist.platform
+ >>> print(dist.platform)
None
Including various computed attributes::
@@ -199,7 +199,7 @@
You can ask a WorkingSet to ``find()`` a distribution matching a requirement::
>>> from pkg_resources import Requirement
- >>> print ws.find(Requirement.parse("Foo==1.0")) # no match, return None
+ >>> print(ws.find(Requirement.parse("Foo==1.0"))) # no match, return None
None
>>> ws.find(Requirement.parse("Bar==0.9")) # match, return distribution
@@ -211,7 +211,7 @@
>>> try:
... ws.find(Requirement.parse("Bar==1.0"))
... except VersionConflict:
- ... print 'ok'
+ ... print('ok')
ok
You can subscribe a callback function to receive notifications whenever a new
@@ -219,7 +219,7 @@
once for each existing distribution in the working set, and then is called
again for new distributions added thereafter::
- >>> def added(dist): print "Added", dist
+ >>> def added(dist): print("Added", dist)
>>> ws.subscribe(added)
Added Bar 0.9
>>> foo12 = Distribution(project_name="Foo", version="1.2", location="f12")
copying setuptools/tests/indexes/test_links_priority/external.html -> build/src/setuptools/tests/indexes/test_links_priority
copying setuptools/tests/indexes/test_links_priority/simple/foobar/index.html -> build/src/setuptools/tests/indexes/test_links_priority/simple/foobar
copying docs/conf.py -> build/src/docs
copying docs/roadmap.txt -> build/src/docs
copying docs/using.txt -> build/src/docs
copying docs/index.txt -> build/src/docs
copying docs/pkg_resources.txt -> build/src/docs
copying docs/easy_install.txt -> build/src/docs
copying docs/setuptools.txt -> build/src/docs
copying docs/python3.txt -> build/src/docs
copying docs/build/html/_sources/roadmap.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/using.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/index.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/pkg_resources.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/easy_install.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/setuptools.txt -> build/src/docs/build/html/_sources
copying docs/build/html/_sources/python3.txt -> build/src/docs/build/html/_sources
copying docs/_theme/nature/theme.conf -> build/src/docs/_theme/nature
copying docs/build/html/_static/pygments.css -> build/src/docs/build/html/_static
copying docs/build/html/_static/nature.css -> build/src/docs/build/html/_static
copying docs/build/html/_static/basic.css -> build/src/docs/build/html/_static
copying docs/_theme/nature/static/pygments.css -> build/src/docs/_theme/nature/static
copying docs/_theme/nature/static/nature.css_t -> build/src/docs/_theme/nature/static
copying docs/Makefile -> build/src/docs
copying docs/_templates/indexsidebar.html -> build/src/docs/_templates
copying setup.py -> build/src
copying easy_install.py -> build/src
copying distribute_setup.py -> build/src
copying pkg_resources.py -> build/src
copying site.py -> build/src
copying DEVGUIDE.txt -> build/src
copying CHANGES.txt -> build/src
copying CONTRIBUTORS.txt -> build/src
copying README.txt -> build/src
copying MANIFEST.in -> build/src
copying launcher.c -> build/src
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
Skipping optional fixer: buffer
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
Skipping optional fixer: idioms
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
Skipping optional fixer: set_literal
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
Skipping optional fixer: ws_comma
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
root: Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_egg'
/tmp/pip-build-tz5sq5vx/adafruit-mcp3008/distribute-0.6.14-py3.5.egg
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 143, in use_setuptools
raise ImportError
ImportError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-tz5sq5vx/adafruit-mcp3008/setup.py", line 2, in <module>
use_setuptools()
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 125, in _do_download
_build_egg(egg, tarball, to_dir)
File "/usr/local/lib/python3.5/dist-packages/ez_setup.py", line 116, in _build_egg
raise IOError('Could not build the egg.')
OSError: Could not build the egg.
I am unable to install most if not all of the packages using Python3
Has anyone tried to install the new python packages on a raspberry pi for python 3??
I'm still failing using pip3 install adafruit-ads1x15 (or any other of the adafruit libraries)
I seem to have made progress with this after installing ez_setup inside my venv
wget https://bootstrap.pypa.io/ez_setup.py -O - | python && pip3 install Adafruit_gpio
...[Snip]...
Successfully downloaded Adafruit-gpio adafruit-pureio spidev
Apologies it took a while to look at this but it looks like there was an odd interaction with the ez_setup script and Python 3. Ez_setup is there to install setuptools automatically for python 2, like if you load a Raspberry Pi with Raspian from scratch and don't have pip or anything else installed (unfortunately they don't include the python-setuptools package by default). The problem is ez_setup doesn't seem to work with Python 3 and ultimately isn't necessary since Python 3 includes setuptools. Long story short it's a weird quirk of supporting both Python 2 and 3 that can luckily be worked around in the setup.py.
I just updated all the libraries, including this one, on pip to have a fix. Give a pip3 install of the library a try again (you might want to add the --force option to force it to reinstall in case you installed already). Thanks for raising the issue and investigating!