I'm running Python 2.7.9 on Yosemite (10.10.2), and my pip installation has gone wrong.
I can no longer install pip using get-pip.py:
sth:~ $ sudo python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20204, in <module>
main()
File "get-pip.py", line 152, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 130, in bootstrap
sys.exit(pip.main(["install", "--upgrade"] + packages + args))
File "/tmp/tmpdUeSSr/pip.zip/pip/__init__.py", line 217, in main
File "/tmp/tmpdUeSSr/pip.zip/pip/basecommand.py", line 183, in main
File "/tmp/tmpdUeSSr/pip.zip/pip/compat/dictconfig.py", line 565, in dictConfig
File "/tmp/tmpdUeSSr/pip.zip/pip/compat/dictconfig.py", line 332, in configure
AttributeError: 'module' object has no attribute '_handlerList'
I can use easy_install, and then create a symlink to it in /usr/local/bin, but trying to install using it gives me the same error, subsequently:
sth:~ $ sudo pip install twine
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==6.0.8', 'console_scripts', 'pip')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/__init__.py", line 217, in main
return command.main(cmd_args)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line 183, in main
for name in ["pip._vendor", "distlib", "requests", "urllib3"]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/compat/dictconfig.py", line 565, in dictConfig
dictConfigClass(config).configure()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg/pip/compat/dictconfig.py", line 332, in configure
del logging._handlerList[:]
AttributeError: 'module' object has no attribute '_handlerList'
I'm certain it's not a problem with pip, so wondering what I've done wrong…
Sorry for necroing but for the sake of other googlers:
As pointed out here, you should not install logging with pip as it messes up the system version. I am not sure when this changed though.
So removing yourpythoninstallpath/lib/python2.7/site-packages/logging should remove the error.
I'd gotten a similar error an hour ago and found this question.
However I've solved it just now.
Although you might not think it useful, I hope this answer helps you solving the problem.
In fact, when I use virtualenvwrapper, I want to control an ENV suddenly.
So I created a backup directory for the reason in the same directory where another ENV is.
After that, There were not only 2 ENVs but also 3 directories related to ENV in .virtualenv.
It made some path to site-packages and etc change helter-skelter apparently.
That is why, if you don't confirm the files about Virtualenv, I reccomend you to do.
The error with me is the following.
~ pip freeze
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==6.0.6', 'console_scripts', 'pip')()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/__init__.py", line 217, in main
return command.main(cmd_args)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/basecommand.py", line 183, in main
for name in ["pip._vendor", "distlib", "requests", "urllib3"]
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/compat/dictconfig.py", line 565, in dictConfig
dictConfigClass(config).configure()
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/compat/dictconfig.py", line 332, in configure
del logging._handlerList[:]
AttributeError: 'module' object has no attribute '_handlerList'
Related
Trying to install package with following command and got an error
pip install pyleniumio
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
status = self.run(options, args)
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
return func(self, options, args)
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 407, in run
use_user_site=options.use_user_site,
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\__init__.py", line 71, in install_given_reqs
**kwargs
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\req_install.py", line 811, in install
direct_url=direct_url,
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\install\wheel.py", line 630, in install_wheel
direct_url=direct_url,
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\install\wheel.py", line 452, in install_unpacked_whee
l
dest = getattr(scheme, subdir)
AttributeError: 'Scheme' object has no attribute 'conftest.py'
Some python packages require other ways, for example, the POT package requires a specific C++ compiler to install. Make sure you read the entire instructions and have everything you need. Another thing that works for me if you have all the requirements and you are running Linux like me, you can just simply lead your terminal to where the file is and just run for example python package.py and it installs. Hopefully, this helped you and you can install your package.
I'm trying to install jupyter on Ubuntu 14.04 LTS but I keep getting this error. I tried giving permissions to every folder and run the code as:
sudo -H pip3 install --user jupyter
But nothing worked. I also did the update on pip and it's running the latest version.
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python3.4/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 412, in run_egg_info
self.setup_py, self.name,
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 387, in setup_py
import setuptools # noqa
File "/root/.local/lib/python3.4/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/root/.local/lib/python3.4/site-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/root/.local/lib/python3.4/site-packages/pkg_resources/__init__.py", line 72, in <module>
import packaging.requirements
File "/root/.local/lib/python3.4/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: __call__() missing 1 required positional argument: 'name'
Thanks for the help!
For me it works with the recent pyparsing package. Perhaps you need to upgrade your pyparsing to the recent version. If you installed it with apt-get, you need to remove the python3-pyparsing package, and install it with pip3.
sudo apt remove python3-pyparsing
sudo pip3 install pyparsing
As this answer writes, you need pyparsing>=2.0.2 to avoid this error.
I had this error as well, after a bit of digging I found this question that addresses the same error caused by some other software.
As the author states, the problem is that the call to MARKER_EXPR() should have a 'name' argument but it doesn't.
To fix this, edit line 59 of /usr/local/lib/python3.4/dist-packages/packaging/requirements.py and just add quotes to the call to MARKER_EXPR() like so:
MARKER_EXPR = originalTextFor(MARKER_EXPR(""))("marker")
I used the provided commands on the windows installation section for kivy. Kivy works, at least at the most basic form. It will make the Hello World basic app here, https://kivy.org/docs/guide/basic.html
But when I try to do "python -m pip ###" or "pip ###" where ### is the command (even list) it crashed before executing. When running python from command line the 3 errors are printed at the top, but then python interpreter runs no problem.
This is the output from running a pip command.
C:\Users\G#te_Keep3r>pip list
Error processing line 2 of C:\Python27\lib\site-packages\kivy.deps.glew-0.1.4-py
2.7-nspkg.pth:
Traceback (most recent call last):
File "C:\Python27\lib\site.py", line 152, in addpackage
exec line
File "<string>", line 1, in <module>
KeyError: 'kivy'
Remainder of file ignored
Error processing line 2 of C:\Python27\lib\site-packages\kivy.deps.gstreamer-0.1
.5-py2.7-nspkg.pth:
Traceback (most recent call last):
File "C:\Python27\lib\site.py", line 152, in addpackage
exec line
File "<string>", line 1, in <module>
KeyError: 'kivy'
Remainder of file ignored
Error processing line 2 of C:\Python27\lib\site-packages\kivy.deps.sdl2-0.1.12-p
y2.7-nspkg.pth:
Traceback (most recent call last):
File "C:\Python27\lib\site.py", line 152, in addpackage
exec line
File "<string>", line 1, in <module>
KeyError: 'kivy'
Remainder of file ignored
[INFO ] Kivy v1.8.0
[INFO ] [Logger ] Record log in C:\Users\G#te_Keep3r\.kivy\log
s\kivy_16-04-20_13.txt
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 9, in <module>
File "C:\Python27\lib\site-packages\pip\__init__.py", line 217, in main
return command.main(cmd_args)
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 179, in main
for name in ["pip._vendor", "distlib", "requests", "urllib3"]
File "C:\Python27\lib\logging\config.py", line 794, in dictConfig
dictConfigClass(config).configure()
File "C:\Python27\lib\logging\config.py", line 576, in configure
'%r: %s' % (name, e))
ValueError: Unable to configure handler 'console_errors': 'LogFile' object has
no attribute 'closed'
Seems to me that you have had an old version installed and you didn't remove it before installing a new version, therefore kivy.deps I think(?) crippled your pip a little bit. Maybe you forgot you'd installed kivy before?
Remove the version you tried to install if you can through pip, then remove Kivy 1.8.0 and deps and then install a new version. If you don't have anything important in your python, just throw it away and install it from scratch and spare yourself time.
If you have the portable package kivy provided for 1.8.0, you can use this guide
I had to uninstall my django==1.6.4 and install 1.5 for a project, but now when I install 1.6.4 with pip and try to start a project with django-admin.py startproject PN I get
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/django-admin.py", line 5, in <module>
pkg_resources.run_script('Django==1.6.4', 'django-admin.py')
File "/Library/Python/2.7/site-packages/pkg_resources.py", line 534, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/Library/Python/2.7/site-packages/pkg_resources.py", line 1432, in run_script
raise ResolutionError("No script named %r" % script_name)
pkg_resources.ResolutionError: No script named 'django-admin.py'
martinssmacbook:bin martinspasov$ pip install django==1.6.4
I tried installing 1.6.5 but then when I try to start a project i get
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/django-admin.py", line 4, in <module>
import pkg_resources
File "/Library/Python/2.7/site-packages/pkg_resources.py", line 2876, in <module>
working_set = WorkingSet._build_master()
File "/Library/Python/2.7/site-packages/pkg_resources.py", line 451, in _build_master
return cls._build_from_requirements(__requires__)
File "/Library/Python/2.7/site-packages/pkg_resources.py", line 464, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/Library/Python/2.7/site-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: Django==1.6.4
Any ideas onwhat to do ?
this is because you should delete all 1.6.4 files and then install 1.6.5.
but now there are also 1.6.4 files in your Linux / windows.
in windows,
you should delete the files in python/lib/site-packages/django
to uninstall the main Django files.
nd then delete Django-VERSION-py2.7.egg or fix the VERSION in
it. not just these.
you have to delete following 4 files:
django-admin.exe, django-admin.py,django-admin.exe.manifest,django-admin-script.py
then you can reinstall the django.
(In fact, if you know the file, you can try to edit it with change the version.)
in Linux, you can do like that.
if there 's something wrong, you can try to delete all.
Sorry if this is any easy question
I want to install easy_install for Python 3. Ive tried downloading ezsetup.py and running it but I get this
`Traceback (most recent call last):
File "/Users/Ivan/Desktop/ez_setup.py", line 364, in <module>
sys.exit(main())
File "/Users/Ivan/Desktop/ez_setup.py", line 360, in main
downloader_factory=options.downloader_factory)
File "/Users/Ivan/Desktop/ez_setup.py", line 283, in download_setuptools
log.warn("Downloading %s", url)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/log.py", line 47, in warn
self._log(WARN, msg, args)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/distutils/log.py", line 30, in _log
if stream.errors == 'strict':
AttributeError: errors`
Next, I tried using wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py but I get this:
`wget: command not found`
Any help would be appreciated.