简体   繁体   中英

Strange error while installing packages on python 3.4.3

There is this very strange exception kinda thing happenning when I am trying to install package. I am using the command prompt to locate Python directory (python34) and then run the pip command after locating it to the required directory where the packages are kept. Anyone has an idea. Maybe its stupid, but its frying my brains here.

C:\kushal\DataMining\Python Packages> C:\Python34\Scripts>pip install C:\kushal\DataMining\Python Packages\setuptools-18.3-py2.py3-none-any.whl

You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Exception:
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\pip\basecommand.py", line 232, in main
    status = self.run(options, args)
  File "C:\Python34\lib\site-packages\pip\commands\install.py", line 305, in run
    name, None, isolated=options.isolated_mode,
  File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 181, in from_line
    isolated=isolated)
  File "C:\Python34\lib\site-packages\pip\req\req_install.py", line 54, in __init__
    req = pkg_resources.Requirement.parse(req)
  File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2873, in parse
    reqs = list(parse_requirements(s))
  File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2820, in parse_requirements
    "version spec")
  File "C:\Python34\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2785, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'C:\\kushal\\DataMining\\Python', 'at',
 ':\\kushal\\DataMining\\Python')

The reason you're getting the error is because you didn't use quotes to enclose the path in your command. It should have been:

C:\Python34\Scripts>pip install "C:\kushal\DataMining\Python Packages\setuptools-18.3-py2.py3-none-any.whl"

Or, you could just run

C:\Python34\Scripts>pip install setuptools-18.3-py2.py3-none-any.whl

since you're already in the C:\\kushal\\DataMining\\Python Packages directory, you don't need to spell it all out again.

Finally, to save yourself some time, add C:\\Python34 and C:\\Python34\\Scripts to the beginning of your path. Now, you can just run python program.py or pip install packagename.whl directly without adding the full path every time.

Open command prompt as an administrator. Run >Pip install --upgrade pip. CD to your directory. Setup your tools.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM