I want to run python setup.py install
(the setup script uses setuptools), and I want only the .pyc files to be included in the resulting egg or directory. all .py files must not be present. How can I do this ?
Even in a vanilla version of Python 3.7. 6 (installed via pyenv ), the packages installed by default are both pip and setuptools .
pyc files are created by the Python interpreter when a . py file is imported. They contain the "compiled bytecode" of the imported module/program so that the "translation" from source code to bytecode (which only needs to be done once) can be skipped on subsequent imports if the . pyc is newer than the corresponding .
you generally don't need to worry about setuptools - either it isn't really needed, or the high-level installers will make sure you have a recent enough version installed; in this last case, as long as the operations they have to do are simple enough generally they won't fail.
py files contain the source code of a program. Whereas, . pyc file contains the bytecode of your program.
not with install
, but a possibility is to run the following command
python setup.py bdist_egg --exclude-source-files
and install the resulting egg in dist with easy_install
easy_install dist/eggname.egg
Note that according to the manual install
is nothing but a shortcut to easy_install use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With