python - Windows 10.0.105 Pro 上的 Pip 问题

标签 python windows python-3.x pip

Pip 应该与 Python 3.5 捆绑在一起,但它显然不在我的路径中,而且我没有看到它的二进制文件。

我试过这个解决方法:

C:\Python35>py -m pip install requests
You are using pip version 7.0.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting requests
  Downloading requests-2.9.1-py2.py3-none-any.whl (501kB)
    100% |################################| 503kB 561kB/s
Installing collected packages: requests
Successfully installed requests-2.9.1

看起来是成功了,但是显然还是有问题:

C:\Python35>pip3 install --upgrade pip
'pip3' is not recognized as an internal or external command,
operable program or batch file.

C:\Python35>pip install --upgrade pip
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python35>pip install --upgrade pip
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\Python35>ls
curl.exe  LICENSE.txt   python3.dll     pythonw.exe    tcl
DLLs      NEWS.txt      python3_d.dll   pythonw.pdb    Tools
Doc       python.exe    python35.dll    pythonw_d.exe  vcruntime140.dll
include   python.pdb    python35.pdb    pythonw_d.pdb
Lib       python_d.exe  python35_d.dll  README.txt
libs      python_d.pdb  python35_d.pdb  Scripts

C:\Python35>cd lib

C:\Python35\Lib>ls
__future__.py        dis.py              opcode.py       socketserver.py
__phello__.foo.py    distutils           operator.py     sqlite3
__pycache__          doctest.py          optparse.py     sre_compile.py
_bootlocale.py       dummy_threading.py  os.py           sre_constants.py
_collections_abc.py  email               pathlib.py      sre_parse.py
_compat_pickle.py    encodings           pdb.py          ssl.py
_compression.py      ensurepip           pickle.py       stat.py
_dummy_thread.py     enum.py             pickletools.py  statistics.py
_markupbase.py       filecmp.py          pipes.py        string.py
_osx_support.py      fileinput.py        pkgutil.py      stringprep.py
_pydecimal.py        fnmatch.py          plat-aix4       struct.py
_pyio.py             formatter.py        plat-darwin     subprocess.py
_sitebuiltins.py     fractions.py        plat-freebsd4   sunau.py
_strptime.py         ftplib.py           plat-freebsd5   symbol.py
_threading_local.py  functools.py        plat-freebsd6   symtable.py
_weakrefset.py       genericpath.py      plat-freebsd7   sysconfig.py
abc.py               getopt.py           plat-freebsd8   tabnanny.py
aifc.py              getpass.py          plat-generic    tarfile.py
antigravity.py       gettext.py          plat-linux      telnetlib.py
argparse.py          glob.py             plat-netbsd1    tempfile.py
ast.py               gzip.py             plat-next3      test
asynchat.py          hashlib.py          plat-sunos5     textwrap.py
asyncio              heapq.py            plat-unixware7  this.py
asyncore.py          hmac.py             platform.py     threading.py
base64.py            html                plistlib.py     timeit.py
bdb.py               http                poplib.py       tkinter
binhex.py            idlelib             posixpath.py    token.py
bisect.py            imaplib.py          pprint.py       tokenize.py
bz2.py               imghdr.py           profile.py      trace.py
calendar.py          imp.py              pstats.py       traceback.py
cgi.py               importlib           pty.py          tracemalloc.py
cgitb.py             inspect.py          py_compile.py   tty.py
chunk.py             io.py               pyclbr.py       turtle.py
cmd.py               ipaddress.py        pydoc.py        turtledemo
code.py              json                pydoc_data      types.py
codecs.py            keyword.py          queue.py        typing.py
codeop.py            lib2to3             quopri.py       unittest
collections          linecache.py        random.py       urllib
colorsys.py          locale.py           re.py           uu.py
compileall.py        logging             reprlib.py      uuid.py
concurrent           lzma.py             rlcompleter.py  venv
configparser.py      macpath.py          runpy.py        warnings.py
contextlib.py        macurl2path.py      sched.py        wave.py
copy.py              mailbox.py          selectors.py    weakref.py
copyreg.py           mailcap.py          shelve.py       webbrowser.py
cProfile.py          mimetypes.py        shlex.py        wsgiref
crypt.py             modulefinder.py     shutil.py       xdrlib.py
csv.py               msilib              signal.py       xml
ctypes               multiprocessing     site-packages   xmlrpc
curses               netrc.py            site.py         zipapp.py
datetime.py          nntplib.py          smtpd.py        zipfile.py
dbm                  ntpath.py           smtplib.py
decimal.py           nturl2path.py       sndhdr.py
difflib.py           numbers.py          socket.py

C:\Python35\Lib>ls *pip*
pipes.py

ensurepip:
__init__.py  __main__.py  __pycache__  _bundled  _uninstall.py

C:\Python35\Lib>cd ..

C:\Python35>ls
curl.exe  LICENSE.txt   python3.dll     pythonw.exe    tcl
DLLs      NEWS.txt      python3_d.dll   pythonw.pdb    Tools
Doc       python.exe    python35.dll    pythonw_d.exe  vcruntime140.dll
include   python.pdb    python35.pdb    pythonw_d.pdb
Lib       python_d.exe  python35_d.dll  README.txt
libs      python_d.pdb  python35_d.pdb  Scripts

C:\Python35>cd libs

C:\Python35\libs>ls
_tkinter.lib   python3.lib    python35.lib
libpython35.a  python3_d.lib  python35_d.lib

C:\Python35\libs>cd ..

C:\Python35>ls
curl.exe  LICENSE.txt   python3.dll     pythonw.exe    tcl
DLLs      NEWS.txt      python3_d.dll   pythonw.pdb    Tools
Doc       python.exe    python35.dll    pythonw_d.exe  vcruntime140.dll
include   python.pdb    python35.pdb    pythonw_d.pdb
Lib       python_d.exe  python35_d.dll  README.txt
libs      python_d.pdb  python35_d.pdb  Scripts

 Directory of C:\Python35

12/11/2015  05:06 PM    <DIR>          .
12/11/2015  05:06 PM    <DIR>          ..
12/11/2015  05:06 PM         2,422,784 curl.exe
12/11/2015  04:59 PM    <DIR>          DLLs
12/11/2015  04:59 PM    <DIR>          Doc
12/11/2015  04:58 PM    <DIR>          include
12/11/2015  04:59 PM    <DIR>          Lib
12/11/2015  04:59 PM    <DIR>          libs
12/07/2015  08:03 PM            30,338 LICENSE.txt
12/06/2015  06:32 AM           310,468 NEWS.txt
12/06/2015  01:55 AM            41,240 python.exe
12/06/2015  01:55 AM           405,504 python.pdb
12/06/2015  01:55 AM            51,992 python3.dll
12/06/2015  01:55 AM         3,926,296 python35.dll
12/06/2015  01:55 AM         9,383,936 python35.pdb
12/06/2015  01:52 AM         6,833,664 python35_d.dll
12/06/2015  01:52 AM         7,278,592 python35_d.pdb
12/06/2015  01:52 AM            61,440 python3_d.dll
12/06/2015  01:55 AM            41,240 pythonw.exe
12/06/2015  01:55 AM           405,504 pythonw.pdb
12/06/2015  01:52 AM            64,000 pythonw_d.exe
12/06/2015  01:52 AM           364,544 pythonw_d.pdb
12/06/2015  01:52 AM            64,000 python_d.exe
12/06/2015  01:52 AM           364,544 python_d.pdb
11/22/2015  10:58 PM             8,269 README.txt
12/11/2015  07:39 PM    <DIR>          Scripts
12/11/2015  04:59 PM    <DIR>          tcl
12/11/2015  04:59 PM    <DIR>          Tools
06/25/2015  11:15 PM            88,752 vcruntime140.dll
              19 File(s)     32,147,107 bytes
              10 Dir(s)  63,904,280,576 bytes free

C:\Python35>

最佳答案

您需要将 Scripts 目录导入到您的路径中:

命令:

> setx Path "%Path%;C:\Python35\Scripts"

powershell:

$env:Path = $env:Path + ";C:\Python35\Scripts"

关于python - Windows 10.0.105 Pro 上的 Pip 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34577523/

相关文章:

python - 如何摆脱vs Studio Python 3中突出显示的错误

linux - Linux 上的 Xvfb Selenium headless Chrome 和 Python

python - 如何从现有数据集中生成一组新值?

python - 使用 to_sql 将数据从 pandas dataframe 导入 SQL 数据库时 PC 挂起

python - Holoviews - 使用错误 : Cell magic `%%opts` not found

python - 类型错误 : Direct assignment to the reverse side of a related set is prohibited

windows - 在配备 GeForce 960M 的笔记本电脑上初始化 D3D12 调试接口(interface)失败

windows - 从 Windows 脚本发送邮件

windows - 如何在 Windows Phone 8 的透视表头中添加图像和按钮

python - PyCharm 和 f 弦