Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 安装结果仅在.dist info文件夹中(Pypi打包)_Python_Python 3.x - Fatal编程技术网

Python 安装结果仅在.dist info文件夹中(Pypi打包)

Python 安装结果仅在.dist info文件夹中(Pypi打包),python,python-3.x,Python,Python 3.x,我按照上的说明创建了一个示例包 但是,在安装时,它只在Python的site_packages文件夹中创建一个testvansjoerd-0.0.2.dist-info文件夹。因此,在执行import testvansjoerd 示例包: 我使用python-mpip-v安装——索引url进行安装https://test.pypi.org/simple/ testvansjoerd==0.0.2 日志输出: Config variable 'Py_DEBUG' is unset, Python

我按照上的说明创建了一个示例包

但是,在安装时,它只在Python的site_packages文件夹中创建一个testvansjoerd-0.0.2.dist-info文件夹。因此,在执行
import testvansjoerd

示例包:

我使用
python-mpip-v安装——索引url进行安装https://test.pypi.org/simple/ testvansjoerd==0.0.2

日志输出:

Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Created temporary directory: C:\Users\Sjoerd\AppData\Local\Temp\pip-ephem-wheel-cache-ey0faien
Created temporary directory: C:\Users\Sjoerd\AppData\Local\Temp\pip-req-tracker-ljdapjrw
Created requirements tracker 'C:\\Users\\Sjoerd\\AppData\\Local\\Temp\\pip-req-tracker-ljdapjrw'
Created temporary directory: C:\Users\Sjoerd\AppData\Local\Temp\pip-install-qi420ita
Looking in indexes: https://test.pypi.org/simple/
Collecting testvansjoerd==0.0.2
  1 location(s) to search for versions of testvansjoerd:
  * https://test.pypi.org/simple/testvansjoerd/
  Getting page https://test.pypi.org/simple/testvansjoerd/
  Looking up "https://test.pypi.org/simple/testvansjoerd/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): test.pypi.org:443
  https://test.pypi.org:443 "GET /simple/testvansjoerd/ HTTP/1.1" 304 0
  Analyzing links from page https://test.pypi.org/simple/testvansjoerd/
    Found link https://test-files.pythonhosted.org/packages/72/fd/ce57f8733d33ba55c3e636c43a8ff2c4b937bdd889bc55114a54ed5f5ecc/testvansjoerd-0.0.1-py3-none-any.whl#sha256=b38a90ad54a5207a8eea41f1c33fcc0543d7bf02ffbf7093fe51f128f4666b0c (from https://test.pypi.org/simple/testvansjoerd/), version: 0.0.1
    Found link https://test-files.pythonhosted.org/packages/31/83/7bd547b99d822f90cc4217206e83498e9fb065e50b3329fb6983fbcfa94f/testvansjoerd-0.0.1.tar.gz#sha256=158b30c1bcae241176a28b0811cef3eb1a182636350e5b3d16796d9da664598b (from https://test.pypi.org/simple/testvansjoerd/), version: 0.0.1
    Found link https://test-files.pythonhosted.org/packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl#sha256=67edf813ff53de27d34e5f37dcb0b725a8575a0c6b123ea218e9692f30b818a3 (from https://test.pypi.org/simple/testvansjoerd/), version: 0.0.2
    Found link https://test-files.pythonhosted.org/packages/00/3a/c2c8548319995b1b8b65d9d9d8cef6beefaeb4d8c06ce30f1f61e7b12a68/testvansjoerd-0.0.2.tar.gz#sha256=bdaf1e8352bc983c42fc45372c2c842f0a9a4b9222d1e11917cef15bc6abda6c (from https://test.pypi.org/simple/testvansjoerd/), version: 0.0.2
  Using version 0.0.2 (newest of versions: 0.0.2)
  Created temporary directory: C:\Users\Sjoerd\AppData\Local\Temp\pip-unpack-yo5gc9ek
  Looking up "https://test-files.pythonhosted.org/packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl" in the cache
  Current age based on date: 25
  Starting new HTTPS connection (1): test-files.pythonhosted.org:443
  https://test-files.pythonhosted.org:443 "GET /packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl HTTP/1.1" 304 0
  Using cached https://test-files.pythonhosted.org/packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl
  Downloading from URL https://test-files.pythonhosted.org/packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl#sha256=67edf813ff53de27d34e5f37dcb0b725a8575a0c6b123ea218e9692f30b818a3 (from https://test.pypi.org/simple/testvansjoerd/)
  Added testvansjoerd==0.0.2 from https://test-files.pythonhosted.org/packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl#sha256=67edf813ff53de27d34e5f37dcb0b725a8575a0c6b123ea218e9692f30b818a3 to build tracker 'C:\\Users\\Sjoerd\\AppData\\Local\\Temp\\pip-req-tracker-ljdapjrw'
  Removed testvansjoerd==0.0.2 from https://test-files.pythonhosted.org/packages/8f/d2/0165a096797eaa16aec2fce05e0ad4c511a6518c995fb0778099b335a24a/testvansjoerd-0.0.2-py3-none-any.whl#sha256=67edf813ff53de27d34e5f37dcb0b725a8575a0c6b123ea218e9692f30b818a3 from build tracker 'C:\\Users\\Sjoerd\\AppData\\Local\\Temp\\pip-req-tracker-ljdapjrw'
Installing collected packages: testvansjoerd

Successfully installed testvansjoerd-0.0.2
Cleaning up...
Removed build tracker 'C:\\Users\\Sjoerd\\AppData\\Local\\Temp\\pip-req-tracker-ljdapjrw'
很抱歉这个愚蠢的包名,最初我创建了一个包含连字符的包,并认为这是根本原因

在这一点上,我甚至不确定这是环境问题还是软件包的问题


Windows 10、Python 3.7当前您的项目结构如下所示:

/testvansjoerd
  setup.py
  setup.cfg
  README.md
但是,为了有一个可以导入的最小包,您必须创建一个(一个带有空
\uuuu init\uuuu.py
的文件夹)。项目结构如下所示:

/testvansjoerd
  /testvansjoerd
    __init__.py
  setup.py
  setup.cfg
  README.md

上面的文件结构也在.

Ah中提到过,我现在看到init之前的两个额外空格,我把所有文件都放在了最后一个子文件夹中。类似的错误,但这并没有解决我的问题。