opening python interpreter in command line even when python 3.7 and launcher is not added to path - python-install

I have installed python without adding python to PATH and disabling py launcher. Yet when i type python -3.7 or py -3.7 in the command prompt, the python interpreter opens. As far as i have researched this should not be possible since python is not added to path and the launcher is also not installed.
So when i opened the installer again to modify the settings, the "Add Python to environment variables" checkbox and "py launcher" checkbox is enabled. Is this a new feature in python 3.6 and 3.7 installer to automatically add python to path even when "Add Python 3.6 to Path" checkbox is not ticked?
Any help would be appreciated.

Related

Pycharm bad path to interpreter

I have problem with new created project with PyCharm community 2019.3.
After creating new enviroment with fresh python 3.7 interpreter, the interpreter path in terminal is still related do the linux system path:
(venv) *#*:~/PycharmProjects/test$ python
import sys
sys.executable
--> /usr/bin/python3.7
instead of:
/home/*/PycharmProjects/test/venv/bin/python
but if i check the interpreter path in Pycharm python console then i get proper result.
In project settings Project interpreter path is:
Python3.7 (test) ~/PycharmProjects/test/venv/bin/python
PATH for this interpreter are:
/home/*/PycharmProjects/test/venv/lib/python3.7/site-packages
/usr/bin/python3.7
After creating new venv with python 3.7 and after activate it, problem remains:
echo $PATH
/home/*/PycharmProjects/test/venv2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PATH is ok /home/*/PycharmProjects/test/venv2/bin but interpreter is from /usr/bin/python3.7.
Question How to correct this issue?
On JetBrains link
Turns out that Pycharm v2019.3 Terminal PATH is bugged. The issue is not occur in previous versions.

ModuleNotFoundError: No module named 'instabot'

I installed instabot in python by pip but I have this error in my pycharm:
ModuleNotFoundError: No module named 'instabot'
You are using wrong python environment. Go to File->Settings->Project->Project Interpreter. There will be a list of installed packages in python environment PyCharm is currently using. If instabot is not installed, click on the + sign and search for instabot and install it.
Press apply and ok and you can use module.
This can also happen if you set up multiple interpreters with the same version and then assign a python file to the interpreter. You might be adding your packages in PyCharm > File > Settings to one interpreter, but not even realize you have configured another interpreter of the same Python version for a different environment under PyCharm > Python file dropdown > Edit Configuration.

Still running python 2.7 when running python in windows 10 command prompt

When I'm running Flask it runs python 2.7, I want it to run on python 3.6.
When I type into the command prompt:
python
it shows it is running python 2.7
So when I type into the command prompt:
echo %PATH%
it shows that python 3.6 is on the top of the variable list.
SO when the path to 3.6 is on top of the list it should automatically run flask in python 3.6 right?
Your PATH is misconfigured, it should only contains path to folders containing binaries, not path to the binary itself
You should change C:\Python36-32\python.exe to C:\Python36-32

Pygame in PyCharm (or Visual Studio)

Where am I going wrong about with Pygame in PyCharm??
1 I have installed Pycharm and its works
2 I have installed Python and Pygame. I have ran "python -m pygame.examples.aliens" in the cmd and the game loads.
3 I have anaconda3 on my computer and that works i.e. you can use the files in the library
4 When I go to Pycharm and type "import pygame" I get an error line
5 So I try and change the interpreter to where Pygame is located and it does not work.
How do you get Pygame into an interpreter. Or what the hell am I missing.
The package will be available only for the version you've installed, python2 or python3.
It looks like you installed pygame into python2, if this command works in cmd:
python -m pygame.examples.aliens
To check or change the default interpreter used in PyCharm:
-menu File > Build, Execution, Deployment > Console >
Python Console > Python Interpreter
By modifying this you don't change the interpreter in your current projects, you can create a new project to check if Pygame is working now.
In your current projects, you can see what interpreter is enabled, in the top right corner toolbar:
-name of the file > Edit configurations > Python interpreter
Maybe you can install Pygame in Python3 to avoid the issue

Python 3.X or Python 2.7 in Anaconda?

I have installed Anaconda on Windows 7 from the full installer and then created an Anaconda Python 3 environment (py3k) using conda. From my reading of the installation instructions at
http://continuum.io/blog/anaconda-python-3
I type activate py3k at the Anaconda command prompt to obtain that environment and in the Command Prompt window it says
[py3k] C:\users.. etc
which would appear to indicate that I am, in fact, in a Python 3.X environment. However, when I type 'Python' at the prompt I get
Python 2.7.5 | Anaconda ... etc
Am I still in a Python 3.X environment or have I omitted to do something installation-wise or otherwise?
have you tried unset PYTHONPATH, and which python?
If you do that after activating py3, you should be able to the python 3 interpreter. If not, what do you get after executing which python?

Resources