setup() - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: setup() (/thread-4128.html) |
setup() - hare50 - Jul-25-2017 what is the command to turn a setup,py file into a zipped module? I have used C:\> py -3 setup sdistsdist is tagged as unknown RE: setup() - Larz60+ - Jul-25-2017 The docs https://docs.python.org/2/distutils/sourcedist.html are pretty good on this, and it's the first topic RE: setup() - hare50 - Jul-27-2017 thanks for the info, I checked the py3.6 docs and found My setup file was horribly put together. I have installed vsearch in site-packages file but when I try to import it I have had no luck. It is listed in site-packages as "vsearch-1.0.py3.6egg-info" I have tried "from site-packages import vsearch" and get an invalid syntax error with the carat pointing at the hyphen. I have tried various just "import vsearch" and I get a no module found, I thought this would work since 'site-packages' is on the Python search path. I have tried the whole tag "vsearch-1.0.py3.6egg-info" and get an invalid syntax error. I have tried partial tags and also get an invalid syntax error. Any suggestions would be appreciated. One more question can you rename a module to a simpler syntax? RE: setup() - Larz60+ - Jul-28-2017 don't install by moving it into site-packages. While that might work in simple cases, it won't if there are dependencies. You need to install using pip, or setup.py. Please read this tutorial: https://python-forum.io/Thread-Basic-Packaging-Modules-Wheel-pip-setup-py-Freeze RE: setup() - snippsat - Jul-28-2017 Follow tutorial here so you are sure that python and pip work from anywhere in cmd. I guess you follow tutorial in this book. pip can install from either Source Distributions (sdist) or Wheels. Wheel is the preferred format and what i show how to make in Packaging/Modules--Wheel--pip--setup.py--Freeze. hare50 Wrote:sdist is tagged as unknownMake wheel. python setup.py bdist_wheel Make Source Distribution python setup.py sdist Both install with pip pip install name_of_wheel.whl pip install name_of_sdist.zip
RE: setup() - hare50 - Jul-28-2017 although I was in windows10 sdist put my file in a tarball. I added --formats=zip to sdist in setup(). Why the tarball if sdist is supposed to zip files on the windows platform. RE: setup() - snippsat - Jul-28-2017 You can force it make zip. python setup.py sdist --formats=zip But you should really make wheel ☸ RE: setup() - hare50 - Aug-01-2017 Since I can't find a place to start a new thread, I have three questions. 1) where is the place to store binary extensions? 2) will 'import foo' accept a directory? 3)where is the best place to store self-made modules and how do you store them with attributes in the command? RE: setup() - hare50 - Aug-02-2017 I upgraded to 3.6.2 and now a call to 'setup.py' responds with an [errno 2= no module found}. I have search Python36 directory and can only find 'setup.py' in modules I wrote under 3.6.1. where does 'setup.py, reside? RE: setup() - snippsat - Aug-02-2017 hare50 Wrote:where does 'setup.py, reside?You miss the point,you make setup.py If look at my tutorial that has been posted before. Making the first wheel i have setup.py and power.py is same folder.In setup.py i point to py_modules=['power'] module which is file power.py .Then i make wheel. python setup.py bdist_wheel --universal I do not mention Source Distributions(sdist),because wheel is the preferred way. But can make zip file with same setup.py bye running.python setup.py sdist --formats=zip
|