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

Install error with Python 3 #2

Open
chasecaleb opened this issue Jul 10, 2014 · 4 comments
Open

Install error with Python 3 #2

chasecaleb opened this issue Jul 10, 2014 · 4 comments

Comments

@chasecaleb
Copy link

I'm getting an install error for your package on Arch Linux using pip with Python 3, but it works fine with Python 2 (pip2). As best as I can tell it's not a config error on my part, but I could be misinterpreting the log. Here it is:

------------------------------------------------------------
/usr/bin/pip run on Thu Jul 10 12:13:11 2014
Downloading/unpacking Bt-manager
  Getting page https://pypi.python.org/simple/Bt-manager/
  URLs to search for versions for Bt-manager:
  * https://pypi.python.org/simple/Bt-manager/
  Analyzing links from page https://pypi.python.org/simple/BT-Manager/
    Found link https://pypi.python.org/packages/source/B/BT-Manager/BT-Manager-0.1.0.tar.gz#md5=61a0e191a40c2b43b0e818d7446dd236 (from https://pypi.python.org/simple/BT-Manager/), version: 0.1.0
    Found link https://pypi.python.org/packages/source/B/BT-Manager/BT-Manager-0.2.0.tar.gz#md5=0e7a6839b3d640322d1f693c5e5ceff0 (from https://pypi.python.org/simple/BT-Manager/), version: 0.2.0
    Found link https://pypi.python.org/packages/source/B/BT-Manager/BT-Manager-0.3.0.tar.gz#md5=e808054ca2d7015fb22ef7e67b585ddc (from https://pypi.python.org/simple/BT-Manager/), version: 0.3.0
  Using version 0.3.0 (newest of versions: 0.3.0, 0.2.0, 0.1.0)
  Downloading from URL https://pypi.python.org/packages/source/B/BT-Manager/BT-Manager-0.3.0.tar.gz#md5=e808054ca2d7015fb22ef7e67b585ddc (from https://pypi.python.org/simple/BT-Manager/)
  Running setup.py (path:/tmp/pip_build_root/Bt-manager/setup.py) egg_info for package Bt-manager
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/Bt-manager/setup.py", line 44, in <module>
        'Topic :: Communications',
      File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 262, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 287, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 624, in resolve
        env = Environment(self.entries)
      File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 802, in __init__
        self.scan(search_path)
      File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 832, in scan
        self.add(dist)
      File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 852, in add
        dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
    TypeError: unorderable types: str() < NoneType()
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/Bt-manager/setup.py", line 44, in <module>

    'Topic :: Communications',

  File "/usr/lib/python3.4/distutils/core.py", line 108, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 262, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/usr/lib/python3.4/site-packages/setuptools/dist.py", line 287, in fetch_build_eggs

    replace_conflicting=True,

  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 624, in resolve

    env = Environment(self.entries)

  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 802, in __init__

    self.scan(search_path)

  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 832, in scan

    self.add(dist)

  File "/usr/lib/python3.4/site-packages/pkg_resources.py", line 852, in add

    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)

TypeError: unorderable types: str() < NoneType()

----------------------------------------
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/Bt-manager
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python3.4/site-packages/pip/req.py", line 1229, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/lib/python3.4/site-packages/pip/req.py", line 325, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/lib/python3.4/site-packages/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/Bt-manager
@liamw9534
Copy link
Owner

@chasecaleb thanks for raising the issue with me. I am not using python3, and can't guarantee the code will work using python3, but will try to investigate it. It seems likely to be some kind of compatibility issue between pip2 and pip3.

@liamw9534
Copy link
Owner

Just to clarify the versions and distribution I am using in the following test:

  • python3 = 3.2.3
  • pip3 = 1.5.6

I am launching installation with the following command sudo pip3 install bt-manager and obtaining the following output:

Downloading/unpacking bt-manager
  Downloading BT-Manager-0.3.0.tar.gz (87kB): 87kB downloaded
  Running setup.py (path:/tmp/pip_build_root/bt-manager/setup.py) egg_info for package bt-manager

    Installed /tmp/pip_build_root/bt-manager/cffi-0.8.6-py3.2-linux-x86_64.egg
    Searching for pycparser
    Reading http://pypi.python.org/simple/pycparser/
    Best match: pycparser 2.10
    Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.10.tar.gz#md5=d87aed98c8a9f386aa56d365fe4d515f
    Processing pycparser-2.10.tar.gz
    Writing /tmp/easy_install-gaa1gr/pycparser-2.10/setup.cfg
    Running pycparser-2.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gaa1gr/pycparser-2.10/egg-dist-tmp-nz1y4o
    zip_safe flag not set; analyzing archive contents...

    Installed /tmp/pip_build_root/bt-manager/pycparser-2.10-py3.2.egg

Requirement already satisfied (use --upgrade to upgrade): setuptools in /home/liamw/.local/lib/python3.2/site-packages (from bt-manager)
Downloading/unpacking cffi>=0.7 (from bt-manager)
  Downloading cffi-0.8.6.tar.gz (196kB): 196kB downloaded
  Running setup.py (path:/tmp/pip_build_root/cffi/setup.py) egg_info for package cffi

Downloading/unpacking pycparser (from cffi>=0.7->bt-manager)
  Downloading pycparser-2.10.tar.gz (206kB): 206kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pycparser/setup.py) egg_info for package pycparser

Installing collected packages: bt-manager, cffi, pycparser
  Running setup.py install for bt-manager

      File "/usr/local/lib/python3.2/dist-packages/bt_manager/codecs.py", line 103
        print 'Exception:', sys.exc_info()[0]
                         ^
    SyntaxError: invalid syntax

  Running setup.py install for cffi
    building '_cffi_backend' extension
    gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -DUSE__THREAD -I/usr/include/python3.2mu -c c/_cffi_backend.c -o build/temp.linux-x86_64-3.2/c/_cffi_backend.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-3.2/c/_cffi_backend.o -lffi -o build/lib.linux-x86_64-3.2/_cffi_backend.cpython-32mu.so

  Running setup.py install for pycparser

Successfully installed bt-manager cffi pycparser
Cleaning up...

The error output above, during install, is caused by print now becoming a function in python 3 which means all print statements must be parenthesized. So that code won't work in python 3, however, the package has actually installed as we can see by running sudo pip3 show bt-manager:

Name: BT-Manager
Version: 0.3.0
Location: /usr/local/lib/python3.2/dist-packages
Requires: setuptools, cffi

This suggests you have some kind of python3 or pip3 installation problem. You might want to try the following to get the most up-to-date pip packages on your system:

sudo pip3 install --upgrade pip
sudo pip2 install --upgrade pip

@chasecaleb
Copy link
Author

Ah, I didn't realize Python 3 isn't supported. That solves my problem, thank you. If you want to add Python 3 support, you might be able to do it automatically by enabling 2to3 if you use setuptools (http://pythonhosted.org/setuptools/python3.html), but don't worry about doing it just for me.

@liamw9534
Copy link
Owner

@chasecaleb I'll ping you once Python 3 support is added. It may be some way out since the project this work is feeding into hasn't yet fully migrated to Python 3 yet, so this will drive it.

gillg added a commit to gillg/bt-manager that referenced this issue Jul 30, 2017
gillg added a commit to gillg/bt-manager that referenced this issue Aug 3, 2017
gillg added a commit to gillg/bt-manager that referenced this issue Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants