pip install xmltodict not working - python

I am getting following error while installing xmltodict package for python.
pip install xmltodict
Downloading/unpacking xmltodict
Running setup.py egg_info for package xmltodict
Traceback (most recent call last):
File "", line 16, in
File "/tmp/pip-build-root/xmltodict/setup.py", line 36, in
setup_requires=['nose>=1.0', 'coverage'],
File "/usr/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.6/site-packages/distribute-0.6.38-py2.6.egg/setuptools/dist.py", line 221, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/usr/lib/python2.6/site-packages/distribute-0.6.38-py2.6.egg/setuptools/dist.py", line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "/usr/lib/python2.6/site-packages/distribute-0.6.38-py2.6.egg/pkg_resources.py", line 598, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (nose 0.10.4 (/usr/lib/python2.6/site-packages), Requirement.parse('nose>=1.0'))
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 16, in
File "/tmp/pip-build-root/xmltodict/setup.py", line 36, in
setup_requires=['nose>=1.0', 'coverage'],
File "/usr/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python2.6/site-packages/distribute-0.6.38-py2.6.egg/setuptools/dist.py", line 221, in __init__
self.fetch_build_eggs(attrs.pop('setup_requires'))
File "/usr/lib/python2.6/site-packages/distribute-0.6.38-py2.6.egg/setuptools/dist.py", line 245, in fetch_build_eggs
parse_requirements(requires), installer=self.fetch_build_egg
File "/usr/lib/python2.6/site-packages/distribute-0.6.38-py2.6.egg/pkg_resources.py", line 598, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (nose 0.10.4 (/usr/lib/python2.6/site-packages), Requirement.parse('nose>=1.0'))
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/xmltodict
Storing complete log in /root/.pip/pip.log

try this
$ sudo yum install python-xmltodict
And also visit this github issue for more information

Related

Distutils error when installing pyperclip into Mu editor on Windows 10

I'm trying to install the pyperclip module for the Mu editor and running into this pile of errors when I run it through the command line:
C:\Users\Torthew>pip install pyperclip --target C:\Users\Torthew\AppData\Local\Mu\pkgs
Collecting pyperclip
Using cached pyperclip-1.7.0.tar.gz (15 kB)
Installing collected packages: pyperclip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Torthew\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "C:\Users\Torthew\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\commands\install.py", line 395, in run
installed = install_given_reqs(
File "C:\Users\Torthew\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\req\__init__.py", line 67, in install_given_reqs
requirement.install(
File "C:\Users\Torthew\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\req\req_install.py", line 781, in install
scheme = get_scheme(
File "C:\Users\Torthew\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\locations.py", line 185, in get_scheme
scheme = distutils_scheme(
File "C:\Users\Torthew\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip\_internal\locations.py", line 125, in distutils_scheme
i.finalize_options()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.496.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 252, in finalize_options
raise DistutilsOptionError("can't combine user with prefix, "
distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base
How can I fix this?

Cannot install python package in Git Bash

I'm trying to install a package from my company's internal artifactory storage. I'm getting 2 exceptions in Gitbash that I can't understand. When I run Pip Freeze I don't see the install package, so I don't believe it is already installed.
After reading the exceptions, I don't understand what's going on, is anyone familiar with this?
pip install --no-dependencies --user -i https://artifactory.cloud.company.com/artifactory/api/pypi/pypi-python-org/simple git+https://github.kdc.company.com/MandR/package.git
Looking in indexes: https://artifactory.cloud.company.com/artifactory/api/pypi/pypi-python-org/simple
Collecting git+https://github.kdc.company.com/MandR/package.git
Cloning https://github.kdc.company.com/MandR/package.git to c:\users\user_name\appdata\local\temp\pip-req-build-ptb41on4
Exception:
Traceback (most recent call last):
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 339, in check_if_exists
self.satisfied_by = pkg_resources.get_distribution(str(no_marker))
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 476, in get_distribution
dist = get_provider(dist)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 352, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 895, in require
needed = self.resolve(parse_requirements(requirements))
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 786, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pip._vendor.pkg_resources.ContextualVersionConflict: (tables 3.4.3 (c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages), Requirement.parse('tables==3.2.0'), {'package'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
status = self.run(options, args)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
resolver.resolve(requirement_set)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\resolve.py", line 221, in _get_abstract_dist_for
req.check_if_exists(self.use_user_site)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_internal\req\req_install.py", line 350, in check_if_exists
self.req.name
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 476, in get_distribution
dist = get_provider(dist)
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 352, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 895, in require
needed = self.resolve(parse_requirements(requirements))
File "c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 786, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pip._vendor.pkg_resources.ContextualVersionConflict: (tables 3.4.3 (c:\users\user_name\appdata\local\continuum\anaconda3\lib\site-packages), Requirement.parse('tables==3.2.0'), {'package'})
It looks like you have the wrong version of the tables package installed. Trying installing the required version with pip install tables==3.2.0.

InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Jr1szu/Django/

I'm trying to start a Pinax Project for Django.
I setup my Python Virtual Environment.
Upgraded setup tools.
Upgraded pip.
Installed Pinax.
Then when I tried 'pinax start blog my_site', it gave the following error:
Installing Django...
Traceback (most recent call last):
File "/usr/local/bin/pinax", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 63, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 97, in start
pip_install("Django")
File "/usr/local/lib/python2.7/dist-packages/pcli.py", line 23, in pip_install
command.run(opts, [package])
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 707, 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-Jr1szu/Django/
I've tried making a python virtual environment inside my conda environment. Also tried making a standalone python environment. Neither solved it. Also tried installing django using pip.
Gave the following error:
sudo pip install django
The directory '/home/scarlet/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/scarlet/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting django
Downloading Django-2.0.tar.gz (8.0MB)
100% |████████████████████████████████| 8.0MB 62kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-SNP9W5/django/setup.py", line 32, in <module>
version = __import__('django').get_version()
File "django/__init__.py", line 1, in <module>
from django.utils.version import get_version
File "django/utils/version.py", line 61, in <module>
#functools.lru_cache()
AttributeError: 'module' object has no attribute 'lru_cache'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SNP9W5/django/
What would you suggest?
Thank you for the read!
It appears like you are using python 2; if that is correct Django version 2 only supports python 3. Please refer to https://docs.djangoproject.com/en/2.0/releases/2.0/#python-compatibility
You could try installing a lower version of Django:
pip install "Django<2"
you may try:
pip3 install django

python2.7 install python daemon package using pip

When I try to install python daemon package I get this error all the time (installation tried by using pip command & downloading the archive and using pip to install):
pip install python-daemon-2.1.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/7p/x12ctdl94d59qnm_chhj2y240000gn/T/pip-2bGssA-build/setup.py", line 86, in <module>
"Topic :: Software Development :: Libraries :: Python Modules",
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "version.py", line 640, in __init__
super(ChangelogAwareDistribution, self).__init__(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 317, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 372, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 851, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1123, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1135, in obtain
return installer(requirement)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 438, in fetch_build_egg
cmd.ensure_finalized()
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 251, in finalize_options
'dist_version': self.distribution.get_version(),
File "version.py", line 656, in get_version
version_info = self.get_version_info()
File "version.py", line 651, in get_version_info
changelog_path = get_changelog_path(self)
File "version.py", line 552, in get_changelog_path
setup_dirname = os.path.dirname(distribution.script_name)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 122, in dirname
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7p/x12ctdl94d59qnm_chhj2y240000gn/T/pip-2bGssA-build/
I'm new to python, searching for the error code and using the steps provided by other threads doesn't solved the problem.
Just write pip install python-daemon==2.1.2
No need to download python-daemon-2.1.2.tar.gz file while installing from PyPI using pip.
If you want to install using downloaded package follow these steps
tar xvf python-daemon-2.1.2.tar.gz
cd python-daemon-2.1.2
python setup.py install

pip cant install radiopy

I've tried
pip install radiopy
Traceback:
C:\Users\олег\Downloads>pip install radiopy
Collecting radiopy
Using cached radio
py-0.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\29F0~1\AppData\Local\Temp\pip-build-blxa2oob\radiopy\setup.py, line 23, in <module>
version=get_version('radio.py'),
File "C:\Users\29F0~1\AppData\Local\Temp\pip-build-blxa2oob\radiopy\setup.py
return __version__
NameError: name '__version__' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\29F0~1\AppData\Local\Temp\pip-build-blxa2oob\radiopy\
I've also tried:
easy_install radiopy
Traceback:
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 168, in save_modules
saved_exc.resume()
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 143, in resume
six.reraise(type, exc, self._tb)
File "c:\python34\lib\site-packages\pkg_resources\_vendor\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 156, in save_modules
yield saved
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 197, in setup_context yield
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 246, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 276, in run return func()
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 245, in runner
_execfile(setup_script, ns)
File "c:\python34\lib\site-packages\setuptools\sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "C:\Users\29F0~1\AppData\Local\Temp\easy_install-laprrvio\radiopy-0.6\setup.py", line 23, in <module>
File "C:\Users\29F0~1\AppData\Local\Temp\easy_install-laprrvio\radiopy-0.6\setup.py", line 19, in get_version
NameError: name '__version__' is not defined
Lately,
C:\Users\олег>pip install C:\\Users\\олег\\Downloads\\radiopy-0.6.tar.gz
Traceback:
C:\Users\олег>pip install C:\\Users\\олег\\Downloads\\radiopy-0.6.tar.gz
Processing c:\users\олег\downloads\radiopy-0.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\29F0~1\AppData\Local\Temp\pip-8evw0uk0-build\setup.py", line 23, in <module>
version=get_version('radio.py'),
File "C:\Users\29F0~1\AppData\Local\Temp\pip-8evw0uk0-build\setup.py", line 19, in get_version
return __version__
NameError: name '__version__' is not defined
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\29F0~1\AppData\Local\Temp\pip-8evw0uk0-build\
How can I solve this?
The module seems to support Python 2 only. The setup.py contains a very dubious hack to evaluate the __version__ variable:
def get_version(filename):
"""Extract __version__ from file by parsing it."""
with open(filename) as fp:
for line in fp:
if line.startswith('__version__'):
exec(line)
return __version__
What this does is to find a line that starts with __version__, namely __version__ = '0.6', and then execute it as dynamic code with exec, which works. However in Python 3 this doesn't modify local variables and thus __version__ is not defined on the next line.
Even if you fixed this bug, you'd met a countless others as the package is not Python-3-ready at all. The easiest solution would be to use Python 2. But even then I am not too sure if this works correctly on Windows as it is written for the mplayer/mencoder suite, and seems to be very Linux/POSIX minded in its code.

Categories

Resources