dozyaustin
dozyaustin

Reputation: 661

osx pip python3 - installing packages does not create alias

I am fresh reinstalling python 2.7 (python, pip) and 3.6 (python3, pip3). However, when I installed pipenv and virtualenv for pythn3 using pip3 - the corresponding bash commands are not added, so simple things like $ virtualenv --version fail.

What is going on here? can anyone help, please?

Thanks

Upvotes: 0

Views: 602

Answers (1)

jeremye
jeremye

Reputation: 1388

From your Python version directory, Pip installs packages to './lib/python/site-packages/' and creates the binary in './bin/'. If you install a package to your User directory with:

pip install --user [packagename]

the Python version directory is:

/Users/[username]/Library/Python/[version]/

otherwise the directory is usually:

/Library/Frameworks/Python.framework/Versions/[version].

Create a symbolic link from the virtualenv binary in /Users/[username]/Library/Python/3.6/bin/ to /usr/local/bin/ in your path with ln -s:

ln -s /Users/[username]/Library/Python/3.6/bin/virtualenv /usr/local/bin/virtualenv

and you should be all set.

If you need to delete the symbolic link simply use rm:

rm /usr/local/bin/virtualenv

Upvotes: 1

Related Questions