I've always used pip in installing python packages but for some unexplained reason it just stopped working. I have tried the following but still not working
i upgraded pip
i rolled back pip
-i uninstalled my python distribution and reinstalled/upgraded it. Here is a trace back of the kind of error i get whenever i try
installing a package with pip
OS- windows 10
pip install profanity
Collecting profanity
Using cached https://files.pythonhosted.org/packages/f6/b4/07d53456462e26eee50abcae787c9380c01731ccc0b6c96233770e546989/profanity-1.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2698, in get_entry_map
ep_map = self._ep_map
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2669, in __getattr__
raise AttributeError(attr)
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\MEME\AppData\Local\Temp\pip-install-xg7obvs0\profanity\setup.py", line 72, in <module>
['profanity=profanity:main'],
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 128, in setup
_install_setup_requires(attrs)
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 117, in _install_setup_requires
(k, v) for k, v in attrs.items()
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\dist.py", line 370, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 645, in iter_entry_points
entries = dist.get_entry_map(group)
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2701, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "C:\Users\MEME\AppData\Local\Programs\Python\Python37\lib\site-packages\pkg_resources\__init__.py", line 2412, in parse_map
raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\MEME\AppData\Local\Temp\pip-install-xg7obvs0\profanity\
Related
I was trying to install python 3.7 virtualenv packages in my new mac system with runs mac os 10.14.3. But system installation failed due to environment error
Packages:
lxml==3.8.0
Pillow==4.1.1
Fiona==1.7.10.post1
pandas==0.20.2
I Have attached the full crash report in https://pastebin.com/tzMwwHjB
Failed building wheel for Fiona
Failed building wheel for lxml
Failed building wheel for pandas
Failed building wheel for Pillow
Error checking for conflicts.
Traceback (most recent call last):
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2897, in _dep_map
return self.__dep_map
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/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 "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2888, in _parsed_pkg_info
return self._pkg_info
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/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 "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 503, in _warn_about_conflicts
package_set, _dep_info = check_install_conflicts(to_install)
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
package_set, _ = create_package_set_from_installed()
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
package_set[name] = PackageDetails(dist.version, dist.requires())
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2635, in requires
dm = self._dep_map
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2899, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2908, in _compute_dependencies
for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2890, in _parsed_pkg_info
metadata = self.get_metadata(self.PKG_INFO)
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1410, in get_metadata
value = self._get(self._fn(self.egg_info, name))
File "/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1522, in _get
with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/Fiona-1.8.4.dist-info/METADATA'
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/Users/titus/.virtualenvs/julo-ana/lib/python3.7/site-packages/Fiona-1.8.4.dist-info/RECORD'
Can any one know solution for this. Im trying to fix this for last two days still facing it.
Use the supported version of Python
Try the following:
pip3 install --user package-name (for Python3)
pip install --user package-name (for Python2)
Note: Replace package-name with pandas, lxml, etc
I tried to install the module git-pre-push-hook with:
pip3 install git-pre-push-hook
mkdir test
cd test
git init
touch README.md
install-git-pre-push-hook
But this error is thrown after using the command install-git-pre-push-hook
Any idea why this happens?
Traceback (most recent call last):
File "/home/tim/.local/bin/install-git-pre-push-hook", line 11, in <module>
sys.exit(main())
File "/home/tim/.local/lib/python3.6/site-packages/git_pre_push_hook/install.py", line 18, in main
os.path.abspath(git_dir.strip()), 'hooks', 'pre-push'
File "/usr/lib/python3.6/posixpath.py", line 94, in join
genericpath._check_arg_types('join', a, *p)
File "/usr/lib/python3.6/genericpath.py", line 151, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
I am a new developer and learning to code in Python 3.4.2. I am running Debian linux on a Raspberry Pi3. After the fresh install I did both
sudo apt-get update
and
sudo apt-get upgrade
to get everything up to date.
I am trying to test a section of code which uploads a file to Dropbox:
import dropbox
import urllib3
authkey = (my dropbox dev auth key)
with open('test.csv','rb') as f:
dbx = dropbox.Dropbox(authkey)
dbx.files_upload(f.read(), '/test.csv')
Now, I have no idea if the actual Dropbox code is correct, because I am getting the following error when I run the script in the Python shell:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 58, in <module>
assert minor >= 21
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/dbtest.py", line 1, in <module>
import dropbox
File "/usr/local/lib/python3.4/dist-packages/dropbox/__init__.py", line 3, in <module>
from .dropbox import __version__, Dropbox, DropboxTeam, create_session # noqa: F401
File "/usr/local/lib/python3.4/dist-packages/dropbox/dropbox.py", line 18, in <module>
import requests
File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 61, in <module>
raise RuntimeError('Requests dependency \'urllib3\' must be version >= 1.21.1, < 1.22!')
RuntimeError: Requests dependency 'urllib3' must be version >= 1.21.1, < 1.22!
To me this indicates that I have an issue with my urllib3 install, so I go to the bash shell and type:
sudo pip3 install --update urllib3
And get the exact same error message:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 58, in <module>
assert minor >= 21
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load
['__name__'])
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 74, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python3/dist-packages/pip/download.py", line 22, in <module>
import requests, six
File "/usr/local/lib/python3.4/dist-packages/requests/__init__.py", line 61, in <module>
raise RuntimeError('Requests dependency \'urllib3\' must be version >= 1.21.1, < 1.22!')
RuntimeError: Requests dependency 'urllib3' must be version >= 1.21.1, < 1.22!
I have other scripts that use Twilio to send SMS messages and they are no longer working either, yielding the same error message referencing urllib3 version issues.
Can anyone help me resolve this issue or point me in the right direction?
Thank you very much.
On Mac try this:
sudo pip install urllib3==1.23
then
sudo pip install requests
I try to make an easy Python gui, therefore I need to import tkinter. This package is available in Python 3, so I need that interpreter, but I can't get it started in Pycharm. It always asks to install packaging tools and then I get the same error everytime and I can't seem to fix it. I get the following:
Executed command:
/tmp/tmpu8m14jqspycharm-management/pip-9.0.1/setup.py install
Error occured:
AttributeError: module 'setuptools.dist' has no attribute 'check_specifier'
Command output:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2237, in resolve
return functools.reduce(getattr, self.attrs, module)
AttributeError: module 'setuptools.dist' has no attribute 'check_specifier'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/tmpu8m14jqspycharm-management/pip-9.0.1/setup.py", line 92, in <module>
cmdclass={'test': PyTest},
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 272, in __init__
_Distribution.__init__(self,attrs)
File "/usr/lib/python3.5/distutils/dist.py", line 281, in __init__
self.finalize_options()
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 327, in finalize_options
ep.load()(self, ep.name, value)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2239, in resolve
raise ImportError(str(exc))
ImportError: module 'setuptools.dist' has no attribute 'check_specifier'
I already searched some fixes but none actually worked.
Python PIP might not be installed. In Debian based distribution:
sudo apt-get install python3-pip
should solve if you use Python 3.
For Python 2.7x
sudo apt-get install python-pip
Close PyCharm and re-open it.
In this case, it may be possible that python pip (package installer) is not installed. So try installing that first.:
sudo apt-get install python3-pip
I am trying to download a couple of packages in python 3.5 but pip keeps throwing an exception(via pip install pyzmail), please see below:
How do I overcome this issue?
Exception:
Traceback (most recent call last):
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\pip\commands\install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\pip\req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\pip\req.py", line 292, in run_egg_info
logger.notify('Running setup.py (path:%s) egg_info for package %s' % (self.setup_py, self.name))
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\pip\req.py", line 265, in setup_py
import setuptools
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\setuptools__init__.py", line 2, in
from setuptools.extension import Extension, Library
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\setuptools\extension.py", line 5, in
from setuptools.dist import _get_unpatched
File "c:\users\chiruld\appdata\local\programs\python\python35\lib\setuptools\dist.py", line 103
except ValueError, e:
^
SyntaxError: invalid syntax
If you are using Windows.., try right clicking 'cmd.exe' and select 'Run as Administrator' and click 'Yes' to allow the following program to make changes to this computer.