Python setup.py install - remove previous version while updating2019 Community Moderator Electionpython setup.py uninstallHow can I remove a trailing newline in Python?How do I remove an element from a list by index in Python?How can I get a list of locally installed Python modules?Use different Python version with virtualenvpython setup.py uninstallpip install mysql-python fails with EnvironmentError: mysql_config not foundInstalling specific package versions with pipFind which version of package is installed with pipHow to remove a key from a Python dictionary?setup.py how NOT to keep multiple version of packages
Specifying a starting column with colortbl package and xcolor
Source permutation
MySQL importing CSV files really slow
What sort of fish is this
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
Expressing logarithmic equations without logs
Professor forcing me to attend a conference, I can't afford even with 50% funding
Are all players supposed to be able to see each others' character sheets?
This Alpine town?
Does a difference of tense count as a difference of meaning in a minimal pair?
Doubts in understanding some concepts of potential energy
ER diagram relationship node size adjustment
The meaning of ‘otherwise’
How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?
What is this diamond of every day?
What are some noteworthy "mic-drop" moments in math?
Ballot RPC message
How many characters using PHB rules does it take to be able to have access to any PHB spell at the start of an adventuring day?
Confusion about Complex Continued Fraction
What will be the sign of work done?
In the late 1940’s to early 1950’s what technology was available that could melt ice?
What is the generally accepted pronunciation of “topoi”?
Is it possible that a question has only two answers?
Shifting between bemols and diesis in the key signature
Python setup.py install - remove previous version while updating
2019 Community Moderator Electionpython setup.py uninstallHow can I remove a trailing newline in Python?How do I remove an element from a list by index in Python?How can I get a list of locally installed Python modules?Use different Python version with virtualenvpython setup.py uninstallpip install mysql-python fails with EnvironmentError: mysql_config not foundInstalling specific package versions with pipFind which version of package is installed with pipHow to remove a key from a Python dictionary?setup.py how NOT to keep multiple version of packages
I have a setup.py script for my package which I install using python ./setup.py install
What seems to happen is every time I increase the version, the old version is not removed in /usr/local/lib/python2.7/dist-packages so I see multiple versions.
Is there a way to set this up in a way that when a person updates, the old version gets removed?
There is a similar (but not quite) question on SO that asks how to uninstall a package in setup.py but I'm not really looking to uninstall as a separate option. I am looking for a clean 'update' process that removes old versions before installing new ones.
The other option is if I could just cleanly remove the version number from the installed package name, in which case I suppose it would overwrite, but I haven't been successful in doing that. If I remove version, it creates the package name with "0.0" which looks weird.
My setup script:
import io
import os
import sys
from setuptools import setup
#Package meta-data.
NAME = 'my_package'
DESCRIPTION = 'My description'
URL = 'https://github.com/myurl'
EMAIL = 'myemail@gmail.com'
AUTHOR = 'Me'
VERSION = '3.1.12'
setup(name = NAME,
version=VERSION,
py_modules = ['dir.mod1',
'dir.mod2',
]
)
python pip setup.py
add a comment |
I have a setup.py script for my package which I install using python ./setup.py install
What seems to happen is every time I increase the version, the old version is not removed in /usr/local/lib/python2.7/dist-packages so I see multiple versions.
Is there a way to set this up in a way that when a person updates, the old version gets removed?
There is a similar (but not quite) question on SO that asks how to uninstall a package in setup.py but I'm not really looking to uninstall as a separate option. I am looking for a clean 'update' process that removes old versions before installing new ones.
The other option is if I could just cleanly remove the version number from the installed package name, in which case I suppose it would overwrite, but I haven't been successful in doing that. If I remove version, it creates the package name with "0.0" which looks weird.
My setup script:
import io
import os
import sys
from setuptools import setup
#Package meta-data.
NAME = 'my_package'
DESCRIPTION = 'My description'
URL = 'https://github.com/myurl'
EMAIL = 'myemail@gmail.com'
AUTHOR = 'Me'
VERSION = '3.1.12'
setup(name = NAME,
version=VERSION,
py_modules = ['dir.mod1',
'dir.mod2',
]
)
python pip setup.py
add a comment |
I have a setup.py script for my package which I install using python ./setup.py install
What seems to happen is every time I increase the version, the old version is not removed in /usr/local/lib/python2.7/dist-packages so I see multiple versions.
Is there a way to set this up in a way that when a person updates, the old version gets removed?
There is a similar (but not quite) question on SO that asks how to uninstall a package in setup.py but I'm not really looking to uninstall as a separate option. I am looking for a clean 'update' process that removes old versions before installing new ones.
The other option is if I could just cleanly remove the version number from the installed package name, in which case I suppose it would overwrite, but I haven't been successful in doing that. If I remove version, it creates the package name with "0.0" which looks weird.
My setup script:
import io
import os
import sys
from setuptools import setup
#Package meta-data.
NAME = 'my_package'
DESCRIPTION = 'My description'
URL = 'https://github.com/myurl'
EMAIL = 'myemail@gmail.com'
AUTHOR = 'Me'
VERSION = '3.1.12'
setup(name = NAME,
version=VERSION,
py_modules = ['dir.mod1',
'dir.mod2',
]
)
python pip setup.py
I have a setup.py script for my package which I install using python ./setup.py install
What seems to happen is every time I increase the version, the old version is not removed in /usr/local/lib/python2.7/dist-packages so I see multiple versions.
Is there a way to set this up in a way that when a person updates, the old version gets removed?
There is a similar (but not quite) question on SO that asks how to uninstall a package in setup.py but I'm not really looking to uninstall as a separate option. I am looking for a clean 'update' process that removes old versions before installing new ones.
The other option is if I could just cleanly remove the version number from the installed package name, in which case I suppose it would overwrite, but I haven't been successful in doing that. If I remove version, it creates the package name with "0.0" which looks weird.
My setup script:
import io
import os
import sys
from setuptools import setup
#Package meta-data.
NAME = 'my_package'
DESCRIPTION = 'My description'
URL = 'https://github.com/myurl'
EMAIL = 'myemail@gmail.com'
AUTHOR = 'Me'
VERSION = '3.1.12'
setup(name = NAME,
version=VERSION,
py_modules = ['dir.mod1',
'dir.mod2',
]
)
python pip setup.py
python pip setup.py
edited Mar 7 at 8:21
Rene B.
528521
528521
asked Mar 6 at 14:19
user1361529user1361529
9641231
9641231
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you want to remove previous versions from your packages then you could use pip in the parent directory of your package. Lets assume your setup.py is in the directory my_package then you can use:
pip install my_package --upgrade
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025277%2fpython-setup-py-install-remove-previous-version-while-updating%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to remove previous versions from your packages then you could use pip in the parent directory of your package. Lets assume your setup.py is in the directory my_package then you can use:
pip install my_package --upgrade
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
add a comment |
If you want to remove previous versions from your packages then you could use pip in the parent directory of your package. Lets assume your setup.py is in the directory my_package then you can use:
pip install my_package --upgrade
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
add a comment |
If you want to remove previous versions from your packages then you could use pip in the parent directory of your package. Lets assume your setup.py is in the directory my_package then you can use:
pip install my_package --upgrade
If you want to remove previous versions from your packages then you could use pip in the parent directory of your package. Lets assume your setup.py is in the directory my_package then you can use:
pip install my_package --upgrade
edited Mar 6 at 18:06
answered Mar 6 at 14:34
Rene B.Rene B.
528521
528521
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
add a comment |
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
force does not remove old versions. It only force overwrites the current version.
– user1361529
Mar 6 at 14:50
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
therefore you could use "pip install my_package --upgrade"
– Rene B.
Mar 6 at 15:40
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
Thanks for editing your answer. The pip based approach works just fine. I do think you should remove the force suggestion as an alternate. It doesn't do what the Q was asking
– user1361529
Mar 6 at 17:54
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025277%2fpython-setup-py-install-remove-previous-version-while-updating%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown