Fatal error in launcher: Unable to create process using '"' in python - python

I had python 2.7 before and then I installed python 3.4.The OS is windows 10
I have renamed
C:\python27\python.exe to python2.exe (when I run python2 --version it shows correct version)
and
C:\python34\python.exe to python3.exe (when I run python3 --version it shows correct version)
I have set the path variable manually and there is no space etc.
I was trying to create a virtual environment and assign python34 to this new environment.
I was going through this SO reference -- Using VirtualEnv with multiple Python versions on windows
prompt>> virtualenv -p c:\Python34\python3.exe casenv
But I got an error--
Fatal error in launcher: Unable to create process using '"'
Do I need to install virtualenv again for python34 or somewhere I need to set virtualenv path for each python installation.
Any help is highly welcomed.

In my case, i had installed python 3.6 and uninstalled python 2.7 when i got this error.
Completely deleting the C:\Python2.7 directory did the trick.

This error is usually caused because of python directory of different versions stored at same location.
i.e in my case I was using python 3.5.X for development and when I updated to 3.7.6 I got this error.
People on internet suggest that it is because of pip but main cause is 2 or more python directory.
The following steps should fix it:
Uninstall previous python version (or use virtual environment if you want to play with multiple python version)
Delete the python directory you are not using (as it causes confusion for terminal to understand which python path it should pick to execute the command)
and this should fix the error of
fatal error in launcher unable to create process using ' '

Pip version: 10.0.0
Python version: 3.6.5 64 bit
Operating system: Windows 7 Ultimate, Service Pack 1, 64-bit
Description:
After upgrading pip to the version 10.0.0 (from Pycharm, that is using pip as a package) any attempts to start updated pip cause an error:
Fatal error in launcher: Unable to create process using '""c:\program files\python 3.6\python.exe" "C:\Program Files\Python 3.6\Scripts\pip.EXE"'
Command python -m pip works as expected.
I found text "Fatal error in launcher" only in executables:
src\pip_vendor\distlib\t32.exe
src\pip_vendor\distlib\t64.exe
and in the pip.exe itself.
After
python -m pip uninstall pip
easy_install.exe pip
error disappeared.
It is interesting, that initially pip.exe had almost the same size as t64.exe, now it significantly shorter.

If someone came after installing a newer version like 3.X and uninstalled the older version, what you need to do is to delete the old version's folder from C Drive.

Clean Fix (Windows)
The fastest way to fix the issue you were facing is to uninstall and reinstall.
Why it happened?
You probably moved the directory where python was installed.
You probably have both environmental variables listed in Environmental Variables.
Things to consider
You can only use 1 active version of python at a time if you use the MSI installer.
If you downloaded the zip file of Python, you can have unlimited versions in your computer BUT you can only have 1 active version under Environmental Variables.
You can always use any version of Python explicitly by writing the direct path to the specific location of the version of Python.

Related

python3 -m venv .venv Error: [WinError 2]

As the title shows, I get an error when attempting to run python3 -m venv .venv: Error: [WinError 2] The system cannot find the file specified. I am running the command in Bash on Windows. I have python version 3.8.7.
I tried copying "python.exe" to also have "python3.exe" which may be worth noting.
Python is installed here: C:\Users\me\AppData\Local\Programs\Python\Python38
Path includes: C:\Users\me\AppData\Local\Programs\Python\Python38\Scripts
and C:\Users\me\AppData\Local\Programs\Python\Python38\
Any remedies to this issue, thank you all.
Since you are working with windows, you can specify python version with python absolute path as mentioned previously or with python launcher (which is installed with python) with py command.
you can list installed python versions with py -0 then you can get output similar to this:
Installed Pythons found by py Launcher for Windows
-3.9-64 *
-3.8-32
-3.7-64
-3.6-64
-2.7-64
Then you can specify python version you want by typing it as listed.
python3 command is almost used in linux os which have installed python 2.x so python refer to python 2.x and python3 refers to python 3.x.
More information i found from this answer post Link.

I have a error on installing CPLEX 12.10 to Python 3.8

I am trying to install CPLEX studio 12.10 to Python 3.8. I'm using Visual studio code editor.
Referring to https://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/GettingStarted/topics/set_up/Python_setup.html, I use the command "python setup.py install --home C:\Program Files\IBM\ILOG\CPLEX_Studio1210\cplex\python\3.7\x64_win64". But error " can't open file 'setup.py': [Errno 2] No such file or directory" is appeared.
How to solve this problem?. I also checked that setup.py is in the above folder.
You need to find setup.py first by going the folder that CPLEX is installed (use the path you wrote after install --home). Furthermore, the path after install --home is to the directory where your Python is installed. See this answer for details.
Also, CPLEX 12.10 doesn't support Python 3.8 for now.
There is a workaround for this problem if you are able to modify the underlying python library shipped with CPLEX. Essentially, the python interface is the same, but the program will check your python version and prevent you from installing and using it if the version does not match.
Go to /path/to/installation/cplex/python, you should see 2 directories (3.6 and 3.7). Make a copy of 3.7 and rename it as your python version, for example, 3.8 or 3.9. In /path/to/installation/cplex/python/<your_python_version>/<your_os>/setup.py and /path/to/installation/cplex/python/<your_python_version>/<your_os>/cplex/_internal/_pycplex_platform.py, remove the code that checks python version.
The above is tested on x86_64 Linux with python 3.9.2 using the official docplex library (you will need to export an environmental variable, see the official documentation). I suppose if you run setup.py to install the cplex python libaray, it should also work. Beware this is not officially supported, and do it at your own risk.

Command line issue: whl is not a supported wheel on this platform

I am having issues installing GraphLab in Python 2.7. I downloaded the whl file and have the following line in my command prompt: C:\Python27> pip install GraphLab_Create-1.6.1-cp27-none-win_amd64.whl. However, I get the error GraphLab_Create-1.6.1-cp27-none-win_amd64.whl is not a supported wheel on this platform. I looked at similar issues other people had posted but am unable to find it useful for this particular situation. Any help solving this issue would be great.
And echo %PATH% returns a line containing C:\Python27 and C:\Python27\Scripts.
Edit: I was using Python 3.4 as default, but changed my environment variables so that I am now using Python 2.7 as default. Could this be a possible issue?

How do I install web2py in a virtualenv in Windows 7?

I'm new to Python and I'm trying to install web2py in a virtualenv. I'm running a 32 bit python 2.7.3 installation on a 64 bit Windows 7.
From what I read, this should be the process:
install virtualenv (done)
create the virtualenv (done)
install pywin32 in that env (I've read it needs to be installed before the web2py installation)
install web2py in that env
First and foremost: is that right? If so, then...
I tried installing pywin32 through
'''easy_install pywin32-218.win32-py2.7.exe'''
It went fine. Then, I checked the virtual environment's site-packages for a pywin32 folder and it was there, but I couldn't import it into python ('''ther's no module pywin32'''). The environment was definitely active (I double-checked).
As a test, without using virtualenv, I double-click-installed the pywin32 binary (downloaded the 32 bit version for python 2.7 -- pywin32-218.win32-py2.7.exe) but got an error at the end:
'''close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr'''
I downloaded the file again (could be corrupted), tried installing it again but got the same result.
Could anybody guide me or point me to a step-by-step install of pywin32 (if necessary) and then web2py for windows 7? I'd really appreciate it.
its a bug: http://sourceforge.net/tracker/?func=detail&aid=3402824&group_id=78018&atid=551954,
workaround here : http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/rev/a64d8ac23e61
similar to this: Error installing and running pywin32 2.7
In my experience, the command easy_install pywin32-218.win32-py2.7.exe under an active virtualenv works fine.
To test the installation of pywin32, from python you can try:
from win32api import GetVersionEx
print GetVersionEx()
Obtaining something similar to (windows major version, minor version, build number, platform id, additional informations):
(6, 1, 7601, 2, 'Service Pack 1')
You cannot import module pywin32 because it doesn't exist.
After the installation of pywin32, you can install web2py under the active virtualenv (I tested it until to opening the admin interface, no guarantee after this :-):
download the source code from http://www.web2py.com/init/default/download
unzip it to ...\virtualenvdir\Lib\site-packages\ (obtaining: ...\virtualenvdir\Lib\site-packages\web2py\...)
cd to ...\virtualenvdir\Lib\site-packages\web2py
start the web2py server: python web2py.py
At the date, I couldn't install web2py using pip. First of all, it grabs an old version of web2py from PyPy. When I tryed to use this version of web2py I got an error ImportError: No module named .... The same using pip on a copy of the web2py source file.

Homebrew failing to install postgresql; python 64-bit errors

I'm getting errors when running
$ brew install postgresql
==> Downloading http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2
File already downloaded in /Users/neil/Library/Caches/Homebrew
Warning: Detected a framework Python that does not have 64-bit support in:
/Library/Frameworks/Python.framework/Versions/Current/Python
e configure script seems to prefer this version of Python over any others,
you may experience linker problems as described in:
http://osdir.com/ml/pgsql-general/2009-09/msg00160.html
fix this issue, you may need to either delete the version of Python
own above, or move it out of the way before brewing PostgreSQL.
te that a framework Python in /Library/Frameworks/Python.framework is
e "MacPython" version, and not the system-provided version which is in:
/System/Library/Frameworks/Python.framework
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.2 --datadir=/usr/local/Cellar/postgresql/9.1.2/shar
^C
Here's where python is located.
$ which python
/usr/local/bin/python
I modified my ~/.zshrc PATH from
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
to
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
And although I'm getting python 64-bit errors, my version of python is 64-bit according to this SO post:
$ python -c 'import struct;print( 8 * struct.calcsize("P"))'
64
The problem pointed out in the referenced mailing list post is that the configure step isn't impacted by the PATH here. There's a whole other mechanism used to find things to link against; see Where do I set DYLD_LIBRARY_PATH on Mac OS X for a quick intro. You could try the suggested workaround given by the brew script--rename /Library/Frameworks/Python.framework/Versions/Current/Python to something else to get it out of the linker's search path, repeat the brew install, then put it back.
If you don't need Python bindings in your PostgreSQL, you can also just install it without Python bindings using brew install postgresql --no-python.
This command is installing the server, not the python bindings. Is that what you want? There is a installer for osx that will install the server for you.
Once you have done that, you can install the psycopg2 bindings directly from source.

Categories