You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then I removed the package with pip uninstall and created a package:
(pipdemo) PS C:\Users\daniel\source\repos\pip_package_demo> python -m build
Found existing installation: setuptools 56.0.0
Uninstalling setuptools-56.0.0:
Successfully uninstalled setuptools-56.0.0
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools
Using cached setuptools-57.0.0-py3-none-any.whl (821 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-57.0.0 wheel-0.36.2
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the 'C:\Users\daniel\AppData\Local\Temp\build-env-n082m5j4\Scripts\python.exe -m pip install --upgrade pip' command.
running egg_info
writing src/daniels_package\pip_package_demo.egg-info\PKG-INFO
writing dependency_links to src/daniels_package\pip_package_demo.egg-info\dependency_links.txt
writing requirements to src/daniels_package\pip_package_demo.egg-info\requires.txt
writing top-level names to src/daniels_package\pip_package_demo.egg-info\top_level.txt
reading manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
writing manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
running sdist
running egg_info
writing src/daniels_package\pip_package_demo.egg-info\PKG-INFO
writing dependency_links to src/daniels_package\pip_package_demo.egg-info\dependency_links.txt
writing requirements to src/daniels_package\pip_package_demo.egg-info\requires.txt
writing top-level names to src/daniels_package\pip_package_demo.egg-info\top_level.txt
reading manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
writing manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
running check
warning: check: missing meta-data: if 'author' supplied, 'author_email' should be supplied too
creating pip_package_demo-1.0.5
creating pip_package_demo-1.0.5\src
creating pip_package_demo-1.0.5\src\daniels_package
creating pip_package_demo-1.0.5\src\daniels_package\pip_package_demo.egg-info
creating pip_package_demo-1.0.5\test
copying files to pip_package_demo-1.0.5...
copying README.md -> pip_package_demo-1.0.5
copying pyproject.toml -> pip_package_demo-1.0.5
copying setup.cfg -> pip_package_demo-1.0.5
copying src/daniels_package\pip_package_demo.egg-info\PKG-INFO -> pip_package_demo-1.0.5\src/daniels_package\pip_package_demo.egg-info
copying src/daniels_package\pip_package_demo.egg-info\SOURCES.txt -> pip_package_demo-1.0.5\src/daniels_package\pip_package_demo.egg-info
copying src/daniels_package\pip_package_demo.egg-info\dependency_links.txt -> pip_package_demo-1.0.5\src/daniels_package\pip_package_demo.egg-info
copying src/daniels_package\pip_package_demo.egg-info\requires.txt -> pip_package_demo-1.0.5\src/daniels_package\pip_package_demo.egg-info
copying src/daniels_package\pip_package_demo.egg-info\top_level.txt -> pip_package_demo-1.0.5\src/daniels_package\pip_package_demo.egg-info
copying test\test_daniels_module.py -> pip_package_demo-1.0.5\test
Writing pip_package_demo-1.0.5\setup.cfg
Creating tar archive
removing 'pip_package_demo-1.0.5' (and everything under it)
Found existing installation: setuptools 56.0.0
Uninstalling setuptools-56.0.0:
Successfully uninstalled setuptools-56.0.0
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools
Using cached setuptools-57.0.0-py3-none-any.whl (821 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-57.0.0 wheel-0.36.2
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the 'C:\Users\daniel\AppData\Local\Temp\build-env-rmu3mfvw\Scripts\python.exe -m pip install --upgrade pip' command.
running egg_info
writing src/daniels_package\pip_package_demo.egg-info\PKG-INFO
writing dependency_links to src/daniels_package\pip_package_demo.egg-info\dependency_links.txt
writing requirements to src/daniels_package\pip_package_demo.egg-info\requires.txt
writing top-level names to src/daniels_package\pip_package_demo.egg-info\top_level.txt
reading manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
writing manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
Requirement already satisfied: wheel in c:\users\daniel\appdata\local\temp\build-env-rmu3mfvw\lib\site-packages (from -r C:\Users\daniel\AppData\Local\Temp\build-reqs-i0fu02di.txt (line 1)) (0.36.2)
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the 'C:\Users\daniel\AppData\Local\Temp\build-env-rmu3mfvw\Scripts\python.exe -m pip install --upgrade pip' command.
running bdist_wheel
running build
installing to build\bdist.win-amd64\wheel
running install
running install_egg_info
running egg_info
writing src/daniels_package\pip_package_demo.egg-info\PKG-INFO
writing dependency_links to src/daniels_package\pip_package_demo.egg-info\dependency_links.txt
writing requirements to src/daniels_package\pip_package_demo.egg-info\requires.txt
writing top-level names to src/daniels_package\pip_package_demo.egg-info\top_level.txt
reading manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
writing manifest file 'src/daniels_package\pip_package_demo.egg-info\SOURCES.txt'
Copying src/daniels_package\pip_package_demo.egg-info to build\bdist.win-amd64\wheel\.\pip_package_demo-1.0.5-py3.9.egg-info
running install_scripts
creating build\bdist.win-amd64\wheel\pip_package_demo-1.0.5.dist-info\WHEEL
creating 'C:\Users\daniel\source\repos\pip_package_demo\dist\tmpwewbc4an\pip_package_demo-1.0.5-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to it
adding 'pip_package_demo-1.0.5.dist-info/METADATA'
adding 'pip_package_demo-1.0.5.dist-info/WHEEL'
adding 'pip_package_demo-1.0.5.dist-info/top_level.txt'
adding 'pip_package_demo-1.0.5.dist-info/RECORD'
removing build\bdist.win-amd64\wheel
(pipdemo) PS C:\Users\daniel\source\repos\pip_package_demo>
Then tried to install the tar.gz:
(pipdemo) PS C:\Users\daniel\source\repos\pip_package_demo> pip install .\dist\pip_package_demo-1.0.5.tar.gz
Processing c:\users\daniel\source\repos\pip_package_demo\dist\pip_package_demo-1.0.5.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\daniel\miniconda3\envs\pipdemo\python.exe' 'C:\Users\daniel\miniconda3\envs\pipdemo\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\daniel\AppData\Local\Temp\tmpfse0zwnc'
cwd: C:\Users\daniel\AppData\Local\Temp\pip-req-build-z6xwaq86
Complete output (47 lines):
Traceback (most recent call last):
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 387, in _parse_attr
return getattr(StaticModule(module_name), attr_name)
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 25, in __init__
with open(spec.origin) as strm:
AttributeError: 'NoneType' object has no attribute 'origin'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\daniel\miniconda3\envs\pipdemo\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 280, in <module>
main()
File "C:\Users\daniel\miniconda3\envs\pipdemo\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\daniel\miniconda3\envs\pipdemo\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\build_meta.py", line 154, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\build_meta.py", line 135, in _get_build_requires
self.run_setup()
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\build_meta.py", line 150, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 1, in <module>
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\daniel\miniconda3\envs\pipdemo\lib\distutils\core.py", line 121, in setup
dist.parse_config_files()
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\dist.py", line 772, in parse_config_files
parse_configuration(self, self.command_options,
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 157, in parse_configuration
meta.parse()
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 463, in parse
section_parser_method(section_options)
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 436, in parse_section
self[name] = value
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 220, in __setitem__
value = parser(value)
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 557, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "C:\Users\daniel\AppData\Local\Temp\pip-build-env-iv9drncm\overlay\Lib\site-packages\setuptools\config.py", line 390, in _parse_attr
module = importlib.import_module(module_name)
File "C:\Users\daniel\miniconda3\envs\pipdemo\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'daniels_module'
----------------------------------------
WARNING: Discarding file:///C:/Users/daniel/source/repos/pip_package_demo/dist/pip_package_demo-1.0.5.tar.gz. Command errored out with exit status 1: 'C:\Users\daniel\miniconda3\envs\pipdemo\python.exe' 'C:\Users\daniel\miniconda3\envs\pipdemo\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\daniel\AppData\Local\Temp\tmpfse0zwnc' Check the logs for full command output.
ERROR: Command errored out with exit status 1: 'C:\Users\daniel\miniconda3\envs\pipdemo\python.exe' 'C:\Users\daniel\miniconda3\envs\pipdemo\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\daniel\AppData\Local\Temp\tmpfse0zwnc' Check the logs for full command output.
(pipdemo) PS C:\Users\daniel\source\repos\pip_package_demo>
I can install the whl, but I won't have the module:
(base) PS C:\Users\daniel\source\repos\pip_package_demo> pip install .\dist\pip_package_demo-1.0.6-py3-none-any.whl
Processing c:\users\daniel\source\repos\pip_package_demo\dist\pip_package_demo-1.0.6-py3-none-any.whl
Requirement already satisfied: numpy>=1.19.1 in c:\users\daniel\miniconda3\lib\site-packages (from pip-package-demo==1.0.6) (1.20.1)
Installing collected packages: pip-package-demo
Successfully installed pip-package-demo-1.0.6
(base) PS C:\Users\daniel\source\repos\pip_package_demo>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import daniels_module
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'daniels_module'
>>>
(pipdemo) PS C:\Users\daniel\source\repos\pip_package_demo> pip install --upgrade pip
Requirement already satisfied: pip in c:\users\daniel\miniconda3\envs\pipdemo\lib\site-packages (21.1.1)
Collecting pip
Using cached pip-21.1.2-py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.1
Uninstalling pip-21.1.1:
Successfully uninstalled pip-21.1.1
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\daniel\\AppData\\Local\\Temp\\pip-uninstall-2zg4h9xk\\pip.exe'
Consider using the `--user` option or check the permissions.
(pipdemo) PS C:\Users\daniel\source\repos\pip_package_demo>
Solved: I didn't use packages=find_namespace: but packages=find:. It worked with pip install -e . but didn't work with distribution packages. I also misconfigured the
package_dir=
=src/daniels_package
setting, it should be
package_dir=
=src
and then to call my package starting from daniels_package.
Windows 10, Python 3.9.5. pip 21.1.1
I was following this page: https://packaging.python.org/tutorials/packaging-projects/
I created a repo: https://github.com/danieltuzes/pip_package_demo/
I can install my package locally using
pip install -e .
, and pytest can be executed as expected. Layout and content is available on github.Then I removed the package with pip uninstall and created a package:
Then tried to install the tar.gz:
I can install the whl, but I won't have the module:
Indeed, if I take look on site-package:
There is no source code, nor binary.
If I try to update pip, I get an error:
But then pip says
However, the build step still says I have 21.1.1.
I can upload the package to test.pypi.org with twine: https://test.pypi.org/project/pip-package-demo/
But it seems that the source code is missing again.
The text was updated successfully, but these errors were encountered: