I have Python 2.7.2 installed in the default location, C:\Python27.
I've downloaded pysvn 2.7 from http://pysvn.tigris.org/project_downloads.html > Windows installation kits. Pysvn Windows installer aborts on
pysvn requires Python 2.7 to be installed.
Quitting installation
I've tried both installer files, py27-pysvn-svn1612-1.7.4-1321.exe and py27-pysvn-svn1615-1.7.5-1360.exe. Neither of them works.
How can I convince the installer that I have Python 2.7 installed?
How is the installer determining whether pysvn is installed or not?
Did u perhaps install the 64-bit version of Python? If yes: Try the 32-bit installer.
Background: It seems like the 64-bit installer doesn't properly set the correct values in the windows registry (which is the place where PySVN tries to find Python).
I tried this and it worked perfectly:
Copy HKLM\SOFTWARE\Python\PythonCore\2.7\InstallPath to HKCU\SOFTWARE\Python\PythonCore\2.7\InstallPath.
Same link as above, but a different solution is offered within the thread. It is a problem with the pysvn 32-bit installer looking in the wrong (?) place in the Registry for the installed Python version.
Edit: The 32-bit module still didn't work correctly with the 64-bit Python. The only solution for this is to use 32-bit Python with the module.
Another option is to copy the the registry keys from HKEY_LOCAL_MACHINE\SOFTWARE\Python to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python
http://pysvn.tigris.org/ds/viewMessage.do?dsForumId=1335&viewType=browseAll&dsMessageId=2719385
My case was a bit different. Since my Anaconda install was for Python 3.6, no matter what I did I wasn't able to install PySvn (never got detected).
So since PySvn last release is for Python 3.5, I've created a conda env for Python 3.5.
Open Anaconda prompt and type: conda create -n *myenv* python=3.5
Then, open the win prompt and type regedit.
In regedit, under HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\ I changed the name of the folder from 3.6 to 3.5. Additionally, in HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.5\InstallPath I changed the value of Anaconda's default folder to my Anaconda's env folder (C:\ProgramData\Anaconda3\env\*myenv*).
Then I ran the installed and it worked fined. After installed, I remade the changes in the system registry to the original ones.
Now I can import Pysvn, inside my conda env, without any problems.
Related
I installed official Python then Anaconda3 afterwards (both 3.9)
I suspect it is because I ticked 'Register Anaconda3 as my default Python 3.9' when I was installing Anaconda, that now when I type py -0p in cmd, the path goes to Anaconda (I do not have Anaconda in PATH). I would like Python 3.9 to use the official installation.
Installed Pythons found by py Launcher for Windows *
-3.9-64 C:\Users\xxx\anaconda3\python.exe
What exactly did ticking 'Register Anaconda3 as my default Python 3.9' change in my system? I would like to revert it. I already looked for py.ini and it does not exist beside py.exe and %LOCALAPPDATA%, so it is not that.
With reference to this comment: py launcher does not find my Python 2.7, I deleted \HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.9 in regedit. py -0p gave this output after a reboot, which is what I wanted:
Installed Pythons found by py Launcher for Windows *
-3.9-64 C:\Program Files\Python39\python.exe
My Python installation is system-wide, so the keys for the offical installation exist at \HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.9.
For those who installed Python for their user only, you may want to modify the keys in \HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.9 instead of deleting them.
I haven't used Python in a while, and only in Linux. Now on Windows, and just installed 3.7.4. I noticed immediately that python3.exe is not in the install directory, nor any of the pythonX.x.exe files, that are used for compatibility. I can only access Python through "python" from my command prompt, and old scripts that use Python 3 won't work.
Is there something I am missing here?
Of course, I can solve this for now by using symlinks, but is this an error in 3.7.4, or more likely, have I done something wrong in setting up my environment on Windows?
No, there's nothing wrong. This is just how Python is on Windows. There's the py launcher too that might help you out here.
https://docs.python.org/3/using/windows.html
3.2 The Microsoft Store Package
All three commands are also available with version number suffixes, for example, as python3.exe and python3.x.exe as well as python.exe (where 3.x is the specific version you want to launch, such as 3.7).
Virtual environments can be created with python -m venv and activated and used as normal.
If you have installed another version of Python and added it to your PATH variable, it will be available as python.exe rather than the one from the Microsoft Store. To access the new installation, use python3.exe or python3.x.exe.
Yesterday I uninstalled my Python 3.6 and installed Python 3.7. I simply ran the executable and followed the prompts. Here is a screen shot of my Programs and Features in my Control Panel.
However, when I check the version in the command prompt, it seems like version 3.6 is still running!
If you have an Anaconda Python installation, you can either upgrade it to your chosen version of Python or create a new conda environment with the version you want.
To see what environments you have set up, do conda env list
To upgrade Python in an environment myenv, do activate myenv then conda update python (to get the latest version) or conda install python=x.y.z (to install version x.y.z, assuming it's available from your conda channels)
You probably didn't completely uninstall your old python version and windows is still pointing to the old installation. Edit your PATH and point your new python 3.7 directory.
Go to My Computer/This PC --> right click --> properties --> advanced system settings --> environment variables --> PATH
You should see a path directory that looks something like this:
C:\Users\Programs\Python\Python36\
Change that directory and point to your python 3.7 installation.
If you want you can keep the old installation of python 3.6 on your computer, it's not necessary to uninstall it and you can work on projects using older python versions when needed.
It looks like you have a Python executable in your PATH from a Anaconda installation (hence the Anaconda Inc at the end of your version number).
You have a few options here:
You can either find the Anaconda installation and remove it (echo %path% into the command prompt may help).
Edit your PATH to make sure that your Python 3.7.3 installation is called first before the Anaconda install.
Upgrade your Anaconda installation to the latest version that uses Python 3.7.
When you install anaconda, a box is automatically checked to make your computer see the version of python installed with conda as the primary version, you could probably uninstall conda or change you system env path taking conda off it.
I'm trying to install tensorflow but python 3.7 does not support that, so I want to get python 3.6 instead without using anaconda.
So any suggestion please ?
I have done this multiple times.
My first tip is use virtual environments. That way you can use python 3.6 for what ever project requires that version of python, and python 3.7 for other projects that need that version.
However on windows these are the best steps:
1.) Uninstall python 3.7 from your computer using command prompt
2.) Double check in your program files folder to see if there are any lingering python 3.7 folders you need to delete. Do not delete any site-packages folders or you will need to reinstall the packages you have deleted.
3.) Go to https://www.python.org/downloads/ and download and install python 3.6 and make sure you add it to your path when installing
4.) Open command prompt and type python -V or simply python and check what version you have installed. If you type just python you can use the command exit() after to exit.
But I suggest starting to use Virtual Environments to avoid this issue or downloading different python versions based on specific library needs.
UPDATE
Regarding the point of not deleting site-packages folders. Some of your packages may not be compatible with lower versions of python. This may not be a huge issue for some people, but it is best to check your most commonly used packages to see their compatible python versions before continuing with the downgrade
Consider using pyenv-win in order to manage your global and (per-project) local Python versions.
However, it only works with the Windows Subsystem for Linux.
This solved it for me. Run the following via anaconda prompt
conda create -n py36 python=3.6
activate py36
Select py36 on Anaconda navigator and launch spyder
I have python 3.2 installed and I want to know if I have to uninstall earlier versions before installing newer ones.
Install all the Python X.Y versions you want, but include Python 3.3 or later (last is best, or reinstall it after all the others) to get the Python Launcher that #abarnert mentioned in his comments. It is also available as a standalone installer.
Earlier versions than 3.3 should not register extensions, so the launcher installed by 3.3 or later will remain the default handler for .py files.
From the command line:
py -2 # launch latest 2.x version installed.
py -3 # latest 3.x
py -3.2 # run exact version
py -3.2-32 # run 32-bit version on 64-bit system.
So you can even have mixed 32-bit and 64-bit installations.
The environment variable PY_PYTHON can be set to specify the default Python to run.
In scripts, add a comment of the following forms below to use that version of Python when the script is double-clicked or run from command line via py script.py:
#!python2
#!python3
#!python3.2
#!python3.2-32
See PEP 397 for further details.
You can install multiple versions of Python on Windows, but only the last version you installed will be used by default: when double-clicking a .py file in Windows Explorer, when typing just python at the command line, etc. "Edit in IDLE" on the context menu also uses the last version you installed. To use other versions you'll need to specify the full path of the version you want. Also, if you use the PYTHONPATH environment variable, there's only one of those, and the scripts in the directories specified in PYTHONPATH may or may not work with whatever version of Python you happen to be running. This can be worked around by writing a batch file that sets PYTHONPATH before launching Python.
It generally depends on what OS you are running and how you installed your python. Under linux or Mac OSX, you don't need to unistall the previous version. I am not sure how things are handled for Windows.