0

I use both 2.7 and 3.5 and I want to keep both installed as we still use 2.7 in VFX and Gaming industry.

The problem is when I attempt to install a module in 3.5 (for this example, I'll use "pip3 install beautifulsoup4"), the module installs in the 2.7 folder and not 3.5 folder.

How do I get terminal to install the correct version of Python Module?

For the record I would like the modules to install in this folder:

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

I've tried specifying the directory. I've heard running the "2to3 -w bs4" will convert the code to 3.5 for me but I am unfamiliar with this command so if anyone can correctly format it for me that would be greatly appreciated (I am still a newb so please be descriptive). Thank you!

Thomas A
  • 1
  • 2
  • You say the modules install in the 2.7 folder, but then you say "they install in this folder" and the folder you show says "python3.5". Please clarify this. – BrenBarn Feb 03 '17 at 07:11
  • 1
    Have you thought about using virtualenvs (http://stackoverflow.com/questions/5844869/comprehensive-beginners-virtualenv-tutorial)? – jbndlr Feb 03 '17 at 07:12
  • Hey @BrenBarn sorry for the confusion. What I mean't to say is I would like them to install in the python3.5 folder. – Thomas A Feb 04 '17 at 04:22
  • @jbndlr Virtualenv seems like overkill. I'm looking for a simple and quick solution right inside terminal. Many, many people use both 2.7 and 3.5 someone has to have come up with a solution for this by now. The "2to3 -w bs4" command works but is pretty involved. – Thomas A Feb 04 '17 at 19:09
  • @ThomasA, this is exactly what virtualenvs are designed for: manage different versions of python with different packages installed on the same machine. In your terminal just `workon yourenv` and `pip install yourpackage` and you'll be fine. – jbndlr Feb 05 '17 at 16:56

1 Answers1

0

Look inside your pip3 script. Does the #!-line at the beginning actually contain python3.5?

If not, change it.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94