I have some code working with python 3.6.6 but I have 3.7.2 in enviroment too.When I try to run my code in cmd, it's trying to run with 3.7.2.How can I chance it?
Asked
Active
Viewed 67 times
0
-
Please tell us which OS you're using. Windows, or MAcs – Mar 28 '19 at 17:03
-
I am using Windows 10 and also my problem solved.Thanks. – Ömer Kenan Uçmaklıoğlu Mar 28 '19 at 21:25
-
Ok then I geuss – Mar 29 '19 at 05:17
1 Answers
1
There are a couple of ways you can tell a script to run with a specific version of Python, commonly you'd use a shebang:
#!/user/bin/env/python3.x
However, I think this only works for Linux/Mac which it sounds like you aren't on if you're referring to cmd. You may want to check out this answer which has a few other options that may help: How do I tell a Python script to use a particular version
Alternatively you can set up a virtual environment, which allows you to run different versions of Python, modules and any other environment settings for a specific project. If that sounds like a better solution then this answer should help you out: (Easiest) Way to use Python 3.6 and 3.7 on same computer?

AdamDWalker
- 271
- 3
- 8