In the setup.py
file, I write like this:
from distutils.core import setup
setup(
# skip a lot of information here..
scripts = ["chilin2/ChiLin2.py"],
)
I've setup my package successfully at first time. After a while I update the line 209
of the script into this:
$ sed -n 209p chilin2/ChiLin2.py
macs2_on_merged.param["control_opt"] = "-c " + macs2_on_merged.input["control"]
And then run setup.py
again
$ sudo python3 setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/ChiLin2.py to 755
running install_egg_info
Removing /usr/local/lib/python3.2/site-packages/chilin2-0.1-py3.2.egg-info
Writing /usr/local/lib/python3.2/site-packages/chilin2-0.1-py3.2.egg-info
However, I found that the script file hasn't been changed..
$ sed -n 209p /usr/local/bin/ChiLin2.py
macs2_on_merged["control_opt"] = "-c " + macs2_on_merged.input["control"]
I tried setup.py clean
and then setup.py install
again, but that doesn't solve the problem. Does anyone have ideas about this?
( I found that the Chilin2.py
in the package has an elder time stamp than that in system directory. Is that the reason that setup.py install
doesn't update? Is there a way to solve this? )
@joeforker, pip uses setup.py behind the scenes.
Step 1: Install the latest or current version of Python3 in Windows. Step 2: Now check if pip and python are correctly installed in your system using the following commands. Step 3: Upgrade pip to the latest version to avoid errors during installation.
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
The short answer is that requirements. txt is for listing package requirements only. setup.py on the other hand is more like an installation script. If you don't plan on installing the python code, typically you would only need requirements.
try to uninstall this package and then reinstall it.
pip can uninstall a package :
pip uninstall *packagename*
I found that the Chilin2.py in the package has an elder time stamp than that in system directory.
This is strange. Can you reproduce the bug with these steps:
If you did that (i.e. you edited the script after its first installation), I don’t understand how the latest script can have a modification time that is older than the installed script.
Is that the reason that setup.py install doesn't update?
Definitely: distutils compares file modification times to see if it needs to re-build (for scripts, the build phase consists of copying the files to a temp build dir and adjusting the shebangs).
Is there a way to solve this?
$ touch chilin2/ChiLin2.py
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