Configuring Python3 on MacOS Macports

Forrest forrie at forrie.com
Mon Dec 2 19:03:31 UTC 2019


For aws-cli, I use the current code and this is how you install it, 
setup.py.

Again, when I use the system MacOS python, it does the right thing; when 
I use Macports python3, it ends up installing under a large tree under 
/opt, which is not the correct behavior.    So until I figure out the 
Macports version, I have been using the system python.

How would the virtual environment benefit me here?   It's just an AWS 
interface command, written in python.


_F



On 12/2/19 1:56 PM, Ruben Di Battista wrote:
> Wait wait wait wait...
>
> Why are you doing the `python setup.py` thing? I strongly discourage 
> you to use the system python to install packages globally.
>
> What I suggest you is to use virtualenvs.
>
> * Install py-virtualenv
> * Create virtualenv
> * Activate  the virtual environment
> * Install things locally to the virtual env using pip
> * Deactivate when finished
>
>
> This way you create isolated environments for each one of your 
> applications without messing up with the system packages. You can then 
> delete them if you don't need them anymore without the fear of 
> destroying everything... :)
>
> There are also other tools to make this even more pleasant (pew, pipenv).
>
>
> On Mon, 2 Dec 2019, 19:51 Forrest, <forrie at forrie.com 
> <mailto:forrie at forrie.com>> wrote:
>
>     I'm new to Python and I'm trying to figure out why, for example,
>     when I
>     install aws-cli (from source) using Macports, it doesn't install
>     properly vs /usr/bin/python that does the right thing and places the
>     commands in proper places.   When I run "/opt/local/bin/python
>     setup.py
>     install" it ends up buried in directories under the Macports
>     directory
>     structure, which isn't usable.   Maybe I am missing some ENV
>     variables?
>
>
>
>     F
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20191202/adbec53b/attachment.html>


More information about the macports-users mailing list