似乎无法使用PIP安装我自己的模块

时间:2019-01-17 22:41:57

标签: python pip

我正在关注Paul Barry撰写的 Head First Python 第二版,尝试并学习使用python。我已经创建了一个函数,将其放入模块中,然后为该模块创建了一个分发文件。现在,我想在计算机上安装它,但似乎无法使分发文件在计算机上运行。

我的代码插入Windows 10命令提示符中并导致错误:

C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\mymodules\dist> py -3 -m pip install vlsearch-1.0.tar
Requirement 'vlsearch-1.0.tar' looks like a filename, but the file does not exist
Processing c:\users\coolt\appdata\local\programs\python\python36-32\mymodules\dist\vlsearch-1.0.tar
Exception:
Traceback (most recent call last):
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\download.py", line 715, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\utils\__init__.py", line 602, in unpack_file
    tarfile.is_tarfile(filename) or
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\tarfile.py", line 2448, in is_tarfile
    t = open(name)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\tarfile.py", line 1569, in open
    return func(name, "r", fileobj, **kwargs)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\tarfile.py", line 1634, in gzopen
    fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj)
  File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\gzip.py", line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\coolt\\AppData\\Local\\Programs\\Python\\Python36-32\\mymodules\\dist\\vlsearch-1.0.tar'
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

我很困惑,因为该文件确实存在于我指定的位置。如何安装?

the file exists in the folder that I expect it to

0 个答案:

没有答案
相关问题