Categories
apple ios

How to run other variations of Python out of your terminal.

5. So I created a symlink to it the usage of the command:

ln -s /usr/bin/python3 /usr/native/bin/python37

Why did I want a symlink? For starters, a symlink shall we me run Python 3.7 any time I need via typing in python37, however secondly, I sought after so that you can simply use it in my digital surroundings.

If you don’t learn about digital environments, take a look at my article on what they’re and the right way to simply create one.

6. Now that I had my symlink, I merely navigated to my challenge folder that wanted python python 3.7, and created my digital surroundings, excluding this time, with the -p tag which allowed me to specify my python edition for the rest on this venv example. Type:

virtualenv venv -p python37

7. Next, you need to turn on your new digital surroundings so, you should definitely’re within the mother or father folder and kind:

# For Unix/Linux primarily based, kind:
supply venv/bin/turn on
# For Windows, kind:
. venv/Scripts/turn on

8. Now kind python --version to test if it labored. While you’re inside of your digital surroundings, you’ll kind python, fairly than your new symlink python37, as a result of it’s your number one edition for all initiatives on this surroundings.

9. From this level, I used to be in a position to put in Kivy with out getting any bizarre mistakes, and the entirety labored nice.

Hopefully this is helping you when you ever want to specify a selected edition of Python for a challenge. Answer boards are nice, however once in a while it might probably turn out to be an actual treasure hunt looking for the best solutions.

Happy coding!

  1. If you need to go out your digital surroundings, simply kind the phrase deactivate.
  2. If your required symlink already exists, kind unlink <symlink trail> and it’s going to loose it up for you.