from platform import python_version
print(python_version())
This will give you the exact version of python running your script. eg output:
3.6.5
Answer from Davies Odu on Stack Overflowfrom platform import python_version
print(python_version())
This will give you the exact version of python running your script. eg output:
3.6.5
import sys
sys.executable
will give you the interpreter. You can select the interpreter you want when you create a new notebook. Make sure the path to your anaconda interpreter is added to your path (somewhere in your bashrc/bash_profile most likely).
For example I used to have the following line in my .bash_profile, that I added manually :
export PATH="$HOME/anaconda3/bin:$PATH"
EDIT: As mentioned in a comment, this is not the proper way to add anaconda to the path. Quoting Anaconda's doc, this should be done instead after install, using conda init:
Should I add Anaconda to the macOS or Linux PATH?
We do not recommend adding Anaconda to the PATH manually. During installation, you will be asked “Do you wish the installer to initialize Anaconda3 by running conda init?” We recommend “yes”. If you enter “no”, then conda will not modify your shell scripts at all. In order to initialize after the installation process is done, first run
source <path to conda>/bin/activateand then runconda init
I want to use jupyter lab with python 3.9 not python 3.8
What Python version?
How to check Python version in Conde environment
How to version control Jupyter notebook?
Videos
Hi!
I'm pretty much just a Jupyter noob so here's my problem,
when I run "jupyter lab" in a cmd to launch Jupyter Lab it tells me
[I 22:53:15.258 LabApp] JupyterLab extension loaded from c:\users\<my_user>\appdata\local\programs\python\python38\lib\site-packages\jupyterlab
[I 22:53:15.258 LabApp] JupyterLab application directory is c:\users\<my_user>\appdata\local\programs\python\python38\share\jupyter\laband it runs my python 3.8.X version.
https://preview.redd.it/ndgs69moehz51.png?width=1431&format=png&auto=webp&s=a12becaf7953006f6db94c3562aaea3415c4baaa
I want to change the default app directory (--app-dir) to the "appropriate" folders in python39 instead of python38 for example
c:\users\<my_user>\appdata\local\programs\python\python39\share\jupyter\lab
but these "appropriate" folders don't exist in python39.
What do I have to do?
UPDATE : I got to know anaconda better, more or less, as u/sideOil suggested and it makes it so much easier to keep your python packages updated.