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

Upgrade via pip fails (maybe prompt_toolkit related) #1649

Closed
Strykar opened this issue Jun 28, 2019 · 2 comments
Closed

Upgrade via pip fails (maybe prompt_toolkit related) #1649

Strykar opened this issue Jun 28, 2019 · 2 comments
Labels
Not Us Issues that are not Sopel's responsibility, e.g. a bug in the environment or a dependency

Comments

@Strykar
Copy link

Strykar commented Jun 28, 2019

Trying to upgrade sopel with pip or pip3 fails and sopel won't run under python3, works on 2.

$ sopel -v
Sopel 6.6.0 (running on python 2.7.15)

$ python -V
Python 2.7.15

$ python3 -V
Python 3.6.7

$ uname -a
FreeBSD phreedom 11.2-RELEASE-p9 FreeBSD 11.2-RELEASE-p9 #0 amd64

pip upgrade error -

$ pip install --upgrade sopel
Collecting sopel
  Using cached https://files.pythonhosted.org/packages/24/d0/97d30162ea3e0d2c9189de32f6bd4a31c2eb05f6821ad03358a08efe0919/sopel-6.6.9.tar.gz
Requirement already satisfied, skipping upgrade: xmltodict in ./.local/lib/python3.6/site-packages (from sopel) (0.11.0)
Requirement already satisfied, skipping upgrade: pytz in /usr/local/lib/python3.6/site-packages (from sopel) (2018.7)
Requirement already satisfied, skipping upgrade: praw<6.0.0 in ./.local/lib/python3.6/site-packages (from sopel) (5.4.0)
Requirement already satisfied, skipping upgrade: geoip2 in ./.local/lib/python3.6/site-packages (from sopel) (2.9.0)
Requirement already satisfied, skipping upgrade: requests<3.0.0,>=2.0.0 in /usr/local/lib/python3.6/site-packages (from sopel) (2.21.0)
Requirement already satisfied, skipping upgrade: pyenchant in ./.local/lib/python3.6/site-packages (from sopel) (2.0.0)
Requirement already satisfied, skipping upgrade: dnspython<3.0 in ./.local/lib/python3.6/site-packages (from sopel) (1.16.0)
Collecting ipython<8.0,>=7.0 (from sopel)
  Using cached https://files.pythonhosted.org/packages/a9/2e/41dce4ed129057e05a555a7f9629aa2d5f81fdcd4d16568bc24b75a1d2c9/ipython-7.5.0-py3-none-any.whl
Requirement already satisfied, skipping upgrade: prawcore<0.15,>=0.14.0 in ./.local/lib/python3.6/site-packages (from praw<6.0.0->sopel) (0.14.0)
Requirement already satisfied, skipping upgrade: update-checker>=0.16 in ./.local/lib/python3.6/site-packages (from praw<6.0.0->sopel) (0.16)
Requirement already satisfied, skipping upgrade: maxminddb>=1.4.0 in ./.local/lib/python3.6/site-packages (from geoip2->sopel) (1.4.1)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (2.7)
Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (1.22)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (3.0.4)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (2018.11.29)
Requirement already satisfied, skipping upgrade: pygments in /usr/local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (2.3.0)
Collecting prompt-toolkit<2.1.0,>=2.0.0 (from ipython<8.0,>=7.0->sopel)
  Using cached https://files.pythonhosted.org/packages/f7/a7/9b1dd14ef45345f186ef69d175bdd2491c40ab1dfa4b2b3e4352df719ed7/prompt_toolkit-2.0.9-py3-none-any.whl
Requirement already satisfied, skipping upgrade: jedi>=0.10 in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (0.13.2)
Requirement already satisfied, skipping upgrade: backcall in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (0.1.0)
Requirement already satisfied, skipping upgrade: pexpect; sys_platform != "win32" in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (4.6.0)
Requirement already satisfied, skipping upgrade: decorator in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (4.3.2)
Requirement already satisfied, skipping upgrade: traitlets>=4.2 in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (4.3.2)
Requirement already satisfied, skipping upgrade: pickleshare in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (0.7.5)
Requirement already satisfied, skipping upgrade: setuptools>=18.5 in /usr/local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (40.6.2)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in /usr/local/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython<8.0,>=7.0->sopel) (1.12.0)
Requirement already satisfied, skipping upgrade: wcwidth in ./.local/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython<8.0,>=7.0->sopel) (0.1.7)
Requirement already satisfied, skipping upgrade: parso>=0.3.0 in ./.local/lib/python3.6/site-packages (from jedi>=0.10->ipython<8.0,>=7.0->sopel) (0.3.2)
Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in ./.local/lib/python3.6/site-packages (from pexpect; sys_platform != "win32"->ipython<8.0,>=7.0->sopel) (0.6.0)
Requirement already satisfied, skipping upgrade: ipython-genutils in ./.local/lib/python3.6/site-packages (from traitlets>=4.2->ipython<8.0,>=7.0->sopel) (0.2.0)
ERROR: Error checking for conflicts.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _dep_map
    return self.__dep_map
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2806, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3003, in _parsed_pkg_info
    return self._pkg_info
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2806, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 524, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2727, in requires
    dm = self._dep_map
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3005, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1419, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1607, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/home/strykar/.local/lib/python3.6/site-packages/prompt_toolkit-1.0.15.dist-info/METADATA'
Installing collected packages: prompt-toolkit, ipython, sopel
  Found existing installation: prompt-toolkit 1.0.15
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/usr/home/strykar/.local/lib/python3.6/site-packages/prompt_toolkit-1.0.15.dist-info/RECORD'

pip3 upgrade error -

strykar@phreedom:~$ pip3 install --upgrade sopel
Collecting sopel
  Using cached https://files.pythonhosted.org/packages/24/d0/97d30162ea3e0d2c9189de32f6bd4a31c2eb05f6821ad03358a08efe0919/sopel-6.6.9.tar.gz
Requirement already satisfied, skipping upgrade: xmltodict in ./.local/lib/python3.6/site-packages (from sopel) (0.11.0)
Requirement already satisfied, skipping upgrade: pytz in /usr/local/lib/python3.6/site-packages (from sopel) (2018.7)
Requirement already satisfied, skipping upgrade: praw<6.0.0 in ./.local/lib/python3.6/site-packages (from sopel) (5.4.0)
Requirement already satisfied, skipping upgrade: geoip2 in ./.local/lib/python3.6/site-packages (from sopel) (2.9.0)
Requirement already satisfied, skipping upgrade: requests<3.0.0,>=2.0.0 in /usr/local/lib/python3.6/site-packages (from sopel) (2.21.0)
Requirement already satisfied, skipping upgrade: pyenchant in ./.local/lib/python3.6/site-packages (from sopel) (2.0.0)
Requirement already satisfied, skipping upgrade: dnspython<3.0 in ./.local/lib/python3.6/site-packages (from sopel) (1.16.0)
Collecting ipython<8.0,>=7.0 (from sopel)
  Using cached https://files.pythonhosted.org/packages/a9/2e/41dce4ed129057e05a555a7f9629aa2d5f81fdcd4d16568bc24b75a1d2c9/ipython-7.5.0-py3-none-any.whl
Requirement already satisfied, skipping upgrade: update-checker>=0.16 in ./.local/lib/python3.6/site-packages (from praw<6.0.0->sopel) (0.16)
Requirement already satisfied, skipping upgrade: prawcore<0.15,>=0.14.0 in ./.local/lib/python3.6/site-packages (from praw<6.0.0->sopel) (0.14.0)
Requirement already satisfied, skipping upgrade: maxminddb>=1.4.0 in ./.local/lib/python3.6/site-packages (from geoip2->sopel) (1.4.1)
Requirement already satisfied, skipping upgrade: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (1.22)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (2018.11.29)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0,>=2.0.0->sopel) (2.7)
Requirement already satisfied, skipping upgrade: decorator in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (4.3.2)
Requirement already satisfied, skipping upgrade: pickleshare in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (0.7.5)
Requirement already satisfied, skipping upgrade: setuptools>=18.5 in /usr/local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (40.6.2)
Requirement already satisfied, skipping upgrade: traitlets>=4.2 in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (4.3.2)
Requirement already satisfied, skipping upgrade: pexpect; sys_platform != "win32" in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (4.6.0)
Collecting prompt-toolkit<2.1.0,>=2.0.0 (from ipython<8.0,>=7.0->sopel)
  Using cached https://files.pythonhosted.org/packages/f7/a7/9b1dd14ef45345f186ef69d175bdd2491c40ab1dfa4b2b3e4352df719ed7/prompt_toolkit-2.0.9-py3-none-any.whl
Requirement already satisfied, skipping upgrade: jedi>=0.10 in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (0.13.2)
Requirement already satisfied, skipping upgrade: pygments in /usr/local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (2.3.0)
Requirement already satisfied, skipping upgrade: backcall in ./.local/lib/python3.6/site-packages (from ipython<8.0,>=7.0->sopel) (0.1.0)
Requirement already satisfied, skipping upgrade: ipython-genutils in ./.local/lib/python3.6/site-packages (from traitlets>=4.2->ipython<8.0,>=7.0->sopel) (0.2.0)
Requirement already satisfied, skipping upgrade: six in /usr/local/lib/python3.6/site-packages (from traitlets>=4.2->ipython<8.0,>=7.0->sopel) (1.12.0)
Requirement already satisfied, skipping upgrade: ptyprocess>=0.5 in ./.local/lib/python3.6/site-packages (from pexpect; sys_platform != "win32"->ipython<8.0,>=7.0->sopel) (0.6.0)
Requirement already satisfied, skipping upgrade: wcwidth in ./.local/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython<8.0,>=7.0->sopel) (0.1.7)
Requirement already satisfied, skipping upgrade: parso>=0.3.0 in ./.local/lib/python3.6/site-packages (from jedi>=0.10->ipython<8.0,>=7.0->sopel) (0.3.2)
ERROR: Error checking for conflicts.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _dep_map
    return self.__dep_map
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2806, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3003, in _parsed_pkg_info
    return self._pkg_info
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2806, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 524, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2727, in requires
    dm = self._dep_map
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3005, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1419, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1607, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/home/strykar/.local/lib/python3.6/site-packages/prompt_toolkit-1.0.15.dist-info/METADATA'
Installing collected packages: prompt-toolkit, ipython, sopel
  Found existing installation: prompt-toolkit 1.0.15
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/usr/home/strykar/.local/lib/python3.6/site-packages/prompt_toolkit-1.0.15.dist-info/RECORD'

Run error on python3:

strykar@phreedom:~$ /usr/local/bin/python3 /usr/local/bin/sopel -q -c /home/strykar/.sopel/default.cfg
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2897, in _dep_map
    return self.__dep_map
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2691, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2888, in _parsed_pkg_info
    return self._pkg_info
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2691, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sopel", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3126, in <module>
    @_call_aside
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 792, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2635, in requires
    dm = self._dep_map
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2899, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2908, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2890, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1410, in get_metadata
    value = self._get(self._fn(self.egg_info, name))
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1522, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/home/strykar/.local/lib/python3.6/site-packages/prompt_toolkit-1.0.15.dist-info/METADATA'

Trying to upgrade prompt_toolkit via pip and pip3 fails too - https://gist.github.com/Strykar/fb5873af78c0af483c7ffad9f5f03984

@Exirel Exirel added the Bug Things to squish; generally used for issues label Jun 28, 2019
@dgw
Copy link
Member

dgw commented Jun 28, 2019

I very much doubt that Sopel can do anything about this. The fact that errors are thrown during installation of prompt-toolkit says to me that it's a bug with that package or one of its dependencies, not with Sopel. Possibly this is related to pypa/pip#5839 or similar.

If you can provide further details that conclusively pin the problem on Sopel itself, we can come back to this. But I really don't think we, as Sopel's maintainers, can fix what appears to be a problem in your Python environment.

@dgw dgw closed this as completed Jun 28, 2019
@dgw dgw added the Not Us Issues that are not Sopel's responsibility, e.g. a bug in the environment or a dependency label Jun 28, 2019
@Strykar
Copy link
Author

Strykar commented Jun 28, 2019

@dgw Spot on, apparently someone ran pip as root and broke things. Reinstalling sopel in a virtual environment fixed it.

@dgw dgw removed the Bug Things to squish; generally used for issues label Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not Us Issues that are not Sopel's responsibility, e.g. a bug in the environment or a dependency
Projects
None yet
Development

No branches or pull requests

3 participants