How To Make Setuptools Install A Wheel Containing Multiple Packages?
Solution 1:
It sounds like only few sub-directories like azure.common installed into your environment when you installed dependencies via setup.py with install_requires=['azure-common']. I tried to reproduce this issue, but failed that all files in this package has been installed.
Here is my steps on my local Windows machine as below, which you can refer to.
- Create a directory mkdir setuptmp, and create a virtual environmentvirtualenv setuptmp, then tocd setuptmp.
- Create a - setup.pyfile with the content as below.\- from setuptools import setup, find_packages setup( name = "setuptmp", install_requires = ['azure-common'] )
- Activate the virtual environment via - Scripts\activate.bat.
- Run python setup.py installto install the dependency described in mysetup.py.
- Run - pythonto open the REPL interpreter to test all packages as you said,- (setuptmp) D:\projects\setuptmp>python Python 3.7.1 (v3.7.1:260ec2c36a, Oct 202018, 14:57:15) [MSC v.191564 bit (AMD64)] on win32 Type"help", "copyright", "credits"or"license"for more information. >>> import azure.common >>> import azure.profiles >>> azure.common.__file__ 'D:\\projects\\setuptmp\\lib\\site-packages\\azure_common-1.1.16-py3.7.egg\\azure\\common\\__init__.py'>>> azure.profiles.__file__ 'D:\\projects\\setuptmp\\lib\\site-packages\\azure_common-1.1.16-py3.7.egg\\azure\\profiles\\__init__.py'>>> import azure_common Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'azure_common'
Note: azure_common is not a module, just an egg info directory.
- Check the packages installed in my environment via - cd Lib\site-packages,- dirand- tree azure_common-1.1.16-py3.7.egg /Fas below.- (setuptmp)D:\projects\setuptmp\Lib\site-packages>dirVolumeindriveDisDataVolumeSerialNumberisBA4B-64AADirectoryofD:\projects\setuptmp\Lib\site-packages2018/12/2614:48<DIR>.2018/12/2614:48<DIR>..2018/12/2614:48<DIR>azure_common-1.1.16-py3.7.egg2018/12/2614:4861easy-install.pth2018/12/2614:46126easy_install.py2018/12/2614:46<DIR>pip2018/12/2614:46<DIR>pip-18.1.dist-info2018/12/2614:46<DIR>pkg_resources2018/12/2614:48965setuptmp-0.0.0-py3.7.egg2018/12/2614:46<DIR>setuptools2018/12/2614:46<DIR>setuptools-40.6.3.dist-info2018/12/2614:46<DIR>wheel2018/12/2614:46<DIR>wheel-0.32.3.dist-info2018/12/2614:46<DIR>__pycache__3File(s)1,152bytes11Dir(s)80,896,319,488bytesfree(setuptmp)D:\projects\setuptmp\Lib\site-packages>treeazure_common-1.1.16-py3.7.egg/FFolderPATHlistingforvolumeDataVolumeserialnumberisBA4B-64AAD:\PROJECTS\SETUPTMP\LIB\SITE-PACKAGES\AZURE_COMMON-1.1.16-PY3.7.EGG├─azure│├─common│││client_factory.py│││cloud.py│││credentials.py│││exceptions.py│││_version.py│││__init__.py│││││└─__pycache__││_version.cpython-37.pyc││__init__.cpython-37.pyc│││└─profiles│multiapiclient.py│__init__.py│└─EGG-INFOPKG-INFORECORDrequires.txttop_level.txtWHEEL
- Compare the above with the file structure of - azure-commonpackage downloaded from the link of Pypi website. I decompressed- azure_common-1.1.16-py2.py3-none-any.whlfile using- 7-Zipinto a temp directory and- treeit.- D:\tmp>tree azure_common-1.1.16-py2.py3-none-any/F Folder PATH listing for volume Data Volume serial number is BA4B-64AA D:\tmp\AZURE_COMMON-1.1.16-PY2.PY3-NONE-ANY ├─azure │ ├─common │ │ client_factory.py │ │ cloud.py │ │ credentials.py │ │ exceptions.py │ │ _version.py │ │ __init__.py │ │ │ └─profiles │ multiapiclient.py │ __init__.py │ └─azure_common-1.1.16.dist-info METADATA RECORD top_level.txt WHEEL
Then, you will find the file structure of step 6 & 7 is almost same.
Hope it helps. If you have any concern, please feel free to let me know.
I did the same above on Linux and got the same result. I saved the output of tree lib/ > lib_[before|after].txt of my Linux setuptmp before and after run python setup.py install, then to compare them using diff lib_*.txt as below.
(setuptmp) peter@peterpc:~/setuptmp$ diff lib*.txt
92a93,111
>     │   ├── azure_common-1.1.16-py3.6.egg>     │   │   ├── EGG-INFO>     │   │   │   ├── PKG-INFO>     │   │   │   ├── RECORD>     │   │   │   ├── WHEEL>     │   │   │   ├── requires.txt>     │   │   │   └── top_level.txt>     │   │   └── azure>     │   │       ├── common>     │   │       │   ├── __init__.py>     │   │       │   ├── _version.py>     │   │       │   ├── client_factory.py>     │   │       │   ├── cloud.py>     │   │       │   ├── credentials.py>     │   │       │   └── exceptions.py>     │   │       └── profiles>     │   │           ├── __init__.py>     │   │           └── multiapiclient.py>     │   ├── easy-install.pth
827a847
>     │   ├── setuptmp-0.0.0-py3.6.egg
1043c1063
< 118 directories, 922 files
---
> 123 directories, 937 files
Post a Comment for "How To Make Setuptools Install A Wheel Containing Multiple Packages?"