Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install from source using Python3 #675

Closed
frankrolf opened this issue Nov 7, 2018 · 5 comments
Closed

Cannot install from source using Python3 #675

frankrolf opened this issue Nov 7, 2018 · 5 comments
Assignees

Comments

@frankrolf
Copy link
Member

I solved my problem mentioned in #674 (by running the setup.py file using Python 2).
Not sure this is relevant, but Python 3 does not allow installing through setup.py:

Traceback (most recent call last):
  File "setup.py", line 274, in <module>
    main()
  File "setup.py", line 268, in main
    'install': InstallPlatlib,
  File "/usr/local/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/install.py", line 117, in do_egg_install
    cmd.run()
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 412, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 654, in easy_install
    return self.install_item(None, spec, tmpdir, deps, True)
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 701, in install_item
    self.process_distribution(spec, dist, deps)
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 726, in process_distribution
    self.install_egg_scripts(dist)
  File "/usr/local/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 600, in install_egg_scripts
    dist.get_metadata('scripts/' + script_name)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1405, in get_metadata
    return value.decode('utf-8') if six.PY3 else value
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte
@cjchapman
Copy link
Contributor

Try this:

python3 setup.py bdist_wheel
pip3 install dist/*.whl

@frankrolf
Copy link
Member Author

Thank you @cjchapman. Is this information that should make it into the readme file?

@cjchapman
Copy link
Contributor

@frankrolf Yes.

@cjchapman
Copy link
Contributor

My understanding of the problem is that the python setup.py install approach fails in Python 3 because of assumptions in setuptools that the code we're installing is all Python source. The UnicodeDecodeError error above occurs when the setuptools code tries to interpret one of our binary files as if it consisted of Unicode characters.

The wheel-based instructions work in both Python 2 and Python 3.

@anthrotype
Copy link
Member

@cjchapman correct.

also see my lengthy explanation #677 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants