I am unable to install youtube-dl-api-server. I am using Python 2.7.9. It looks like there is a bug in some dependency. I have tried install from source code but I was with the same result. After running command pip install –pre youtube_dl_server I got this message:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2667, in parse
reqs = list(parse_requirements(s))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2593, in parse_requirements
raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '\xe2\x80\x93r')
Storing debug log for failure in /home/ubuntu/.pip/pip.log
I am using Python 2.7.9 on Ununtu Server. Do you have any idea how to solve this?
Thanks metjuf
There is a strange character in your command, most likely the result of some automatic conversion. I'm talking about – (U+8211, b'\xe2\x80\x93' as UTF-8). So instead of
pip install –pre youtube_dl_server
run
pip install --pre youtube_dl_server
Related
I keep trying to install requests, but every time I do it starts, then gives me this error. Is there any way I can get around this or fix this error so that I can use requests?
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Python27\lib\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 "C:\Python27\lib\site-packages\pip\req.py", line 1265, in prepare_files
req_to_install.extras):
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2291, in requires
dm = self._dep_map
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2508, in _compute_dependencies
parsed = next(parse_requirements(distvers))
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 45, in <lambda>
next = lambda o: o.next()
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources.py", line 2573, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'charset-normalizer ~=2.0.0', 'at', ' ~=2.0.0')
Storing debug log for failure in C:\Users\l--l\pip\pip.log
I have gotten into the files correctly but I cannot seem to get it to download requests.
Re-Install pip
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
python2.7 get-pip.py
Install requests
python2.7 -m pip install requests
OR Manual install
git clone git://github.com/psf/requests.git
cd requests
python2.7 -m pip install .
when I try to install build with
sudo pip3 install build
the following error occurs:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 386, in run
use_user_site=options.use_user_site,
File "/usr/lib/python3/dist-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
**kwargs
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 760, in install
use_user_site=use_user_site, pycompile=pycompile,
File "/usr/lib/python3/dist-packages/pip/_internal/req/req_install.py", line 382, in move_wheel_files
warn_script_location=warn_script_location,
File "/usr/lib/python3/dist-packages/pip/_internal/wheel.py", line 215, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/_internal/locations.py", line 153, in distutils_scheme
d.parse_config_files()
File "/usr/lib/python3.7/distutils/dist.py", line 406, in parse_config_files
parser.read(filename)
File "/usr/lib/python3.7/configparser.py", line 696, in read
self._read(fp, filename)
File "/usr/lib/python3.7/configparser.py", line 1091, in _read
fpname, lineno)
configparser.DuplicateOptionError: While reading from 'setup.cfg' [line 10]: option 'url' in section 'metadata' already exists
while installing the collected packages. The install never completes; pip says it was never installed. I would greatly appreciate any help troubleshooting.
In the off chance anyone else has this problem, I found a temporary fix that will probably make python stop working in a few days.. I went to ln 1088-1090 of /usr/lib/python3.7/configparser.py and replaced that bit about raising an exception after an if statement with
while (self._strict and
(sectname, optname) in elements_added):
elements_added.pop()
This seemed to have fixed the problem, albeit not in the most pretty method, as installation pf build and use of sdist now works ok.
Error log:
Exception:
Traceback (most recent call last):
File "...\env\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "...\env\lib\site-packages\pip\commands\install.py", line 262, in run
for req in parse_requirements(filename, finder=finder, options=options, session=session):
File "...\env\lib\site-packages\pip\req.py", line 1631, in parse_requirements
req = InstallRequirement.from_line(line, comes_from, prereleases=getattr(options, "pre", None))
File "...\env\lib\site-packages\pip\req.py", line 172, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "...\env\lib\site-packages\pip\req.py", line 70, in __init__
req = pkg_resources.Requirement.parse(req)
File "...\env\lib\site-packages\pip\_vendor\pkg_resources.py", line 2667, in parse
reqs = list(parse_requirements(s))
File "...\env\lib\site-packages\pip\_vendor\pkg_resources.py", line 2593, in parse_requirements
raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '\xff\xfeF\x00l\x00a\x00s\x00k\x00=\x00=\x000\x00.\x001\x000\x00.\x001\x00')
The project is being reorganized and the requirement.txt is generated pip freeze > requirements.txt
Requirements.txt
Flask==0.10.1
Flask-SQLAlchemy==1.0
Flask-WTF==0.9.4
Jinja2==2.7.3
MarkupSafe==0.23
SQLAlchemy==0.9.9
WTForms==1.0.5
Werkzeug==0.10.1
itsdangerous==0.24
I copied your requirement file and executed it with python 2.7 with no problems. I think you should try to rewrite the file from scratch in case there is invisible characters messing with your pip install. Another solution could be to paste your requirement into a basic text editor such as gedit or notepad and then copy them back to your requirement file to try deleting the invisible characters.
If it still does not work, try installing each packages one by one via the command line to find out which one causes the problem.
On a Windows 7 machine I am using the following command to install a package from a local directory:
pip install addons/pnc_tests --upgrade --extra-index-url=http://some_server/simple
which results in the following error:
C:\Users\alex\PNC\tas\ENV\Scripts\pip-script.py run on 07/16/14 07:50:47
Exception:
Traceback (most recent call last):
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\commands\install.py", line 258, in run
InstallRequirement.from_line(name, None))
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\req.py", line 173, in from_line
return cls(req, comes_from, url=url, prereleases=prereleases)
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\req.py", line 71, in __init__
req = pkg_resources.Requirement.parse(req)
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\_vendor\pkg_resources.py", line 2667, in parse
reqs = list(parse_requirements(s))
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\_vendor\pkg_resources.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "C:\Users\alex\PNC\tas\ENV\lib\site-packages\pip\_vendor\pkg_resources.py", line 2573, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'addons/pnc_tests', 'at', '/pnc_tests')
How to solve this problem?
I guess you are missing the parameter -r;
It must be like this if you have a requirement file to install from;
pip install -r addons/pnc_tests --upgrade --extra-index-url=http://some_server/simple
As it is defined on;
Pip Documentation
One need to replace the slash (/) by a backslash (\):
pip install addons\pnc_tests --upgrade --extra-index-url=http://some_server/simple
On my system I had just specified the wrong directory. Double check your folder names. x_x
I use python ,and want to install module zope.interface in window 7, I used the cmd :
pip install zope.interface
but the console show :
Removing temporary dir c:\users\000790\appdata\local\temp\pip_build_000790...
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 134, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 236, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python27\lib\site-packages\pip\req.py", line 1092, in prepare_files
self.unpack_url(url, location, self.is_download)
File "C:\Python27\lib\site-packages\pip\req.py", line 1238, in unpack_url
retval = unpack_http_url(link, location, self.download_cache, self.download_dir)
File "C:\Python27\lib\site-packages\pip\download.py", line 622, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "C:\Python27\lib\site-packages\pip\download.py", line 510, in _download_url
logger.end_progress('%s downloaded' % format_size(downloaded))
File "C:\Python27\lib\site-packages\pip\log.py", line 98, in end_progress
"Tried to end_progress without start_progress")
AssertionError: Tried to end_progress without start_progress
Please let me know if you have any workaround for the above error.
Donwload from here the .egg of zope.interface and try this in CMD:
c:\Python27\Scripts\easy_install.exe c:\zope.interface-3.6.1-py2.6-win32.egg
NOTE: To install .egg, we need 'Easy Install' that is part of setuptools. So, we have to install setuptools first. Download it from here.
NOTE 2: the .egg sometimes is unrecognised if it isn't on C:\ path