back and forth between enpkg and github

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

back and forth between enpkg and github

Michael Aye
There is good advise how to deal with installing an updated package
from github, to remove first the official package from EPD by using
'enpkg --remove pkgname' and then to install the updated one.

But going the other way, I am unsure about the best way to uninstall a
package that was installed via the 'python setup.py install' way. Is
there an official command from the distutils that removes a package
that was installed this way?

Cheers,
Michael



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: back and forth between enpkg and github

Robert Kern
On Thu, Feb 28, 2013 at 7:11 PM, K.-Michael Aye <[hidden email]> wrote:
> There is good advise how to deal with installing an updated package
> from github, to remove first the official package from EPD by using
> 'enpkg --remove pkgname' and then to install the updated one.
>
> But going the other way, I am unsure about the best way to uninstall a
> package that was installed via the 'python setup.py install' way. Is
> there an official command from the distutils that removes a package
> that was installed this way?

No. What I usually do is to build an egg and then install it with
egginst. Then I can remove it with egginst later. For projects that
use distribute/setuptools:

  $ cd foo/
  $ python setup.py bdist_egg
  ...
  $ egginst dist/foo-*.egg

For projects that don't use distribute/setuptools, you can do the following:

  $ python -c 'import setuptools;execfile("setup.py")' bdist_egg

To remove the foo egg:

  $ egginst --remove foo

--
Robert Kern
Enthought
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: back and forth between enpkg and github

Michael Aye
On 2013-02-28 19:24:07 +0000, Robert Kern said:

> On Thu, Feb 28, 2013 at 7:11 PM, K.-Michael Aye
> <[hidden email]> wrote:
>> There is good advise how to deal with installing an updated package
>> from github, to remove first the official package from EPD by using
>> 'enpkg --remove pkgname' and then to install the updated one.
>>
>> But going the other way, I am unsure about the best way to uninstall a
>> package that was installed via the 'python setup.py install' way. Is
>> there an official command from the distutils that removes a package
>> that was installed this way?
>
> No. What I usually do is to build an egg and then install it with
> egginst. Then I can remove it with egginst later. For projects that
> use distribute/setuptools:
>
>   $ cd foo/
>   $ python setup.py bdist_egg
>   ...
>   $ egginst dist/foo-*.egg
>
> For projects that don't use distribute/setuptools, you can do the following:
>
>   $ python -c 'import setuptools;execfile("setup.py")' bdist_egg
>
> To remove the foo egg:
>
>   $ egginst --remove foo

Just tried it, works great! Thanks so much!

Michael



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: back and forth between enpkg and github

Jonathan March


On Thu, Feb 28, 2013 at 4:34 PM, K.-Michael Aye <[hidden email]> wrote:
On 2013-02-28 19:24:07 +0000, Robert Kern said:

> On Thu, Feb 28, 2013 at 7:11 PM, K.-Michael Aye
> <[hidden email]> wrote:
>> There is good advise how to deal with installing an updated package
>> from github, to remove first the official package from EPD by using
>> 'enpkg --remove pkgname' and then to install the updated one.
>>
>> But going the other way, I am unsure about the best way to uninstall a
>> package that was installed via the 'python setup.py install' way. Is
>> there an official command from the distutils that removes a package
>> that was installed this way?
>
> No. What I usually do is to build an egg and then install it with
> egginst. Then I can remove it with egginst later. For projects that
> use distribute/setuptools:
>
>   $ cd foo/
>   $ python setup.py bdist_egg
>   ...
>   $ egginst dist/foo-*.egg
>
> For projects that don't use distribute/setuptools, you can do the following:
>
>   $ python -c 'import setuptools;execfile("setup.py")' bdist_egg
>
> To remove the foo egg:
>
>   $ egginst --remove foo

Just tried it, works great! Thanks so much!

Not as elegant as building and toggling an egg, but useful for a package in flux -- you can use:
   python setup.py develop 
whose only effect on site-packages, AFAIK, is to add a line to easy-install.pth.
If you remove or comment out that line, then you have effectively uninstalled the package from your python.

Jonathan


Michael



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev