Bad Interpreter: No such file or directory error when launching iPython with Anaconda - python-2.7

My ipython was working fine until I installed a new IDE and accidentally changed some path settings. Now, when I try to launch ipython from terminal I get:
-bash: /Users/JohnSmith/anaconda/bin/ipython: /Users/JohnSmith/anaconda/python.app/Contents/MacOS/python: bad interpreter: No such file or directory
How do I change my path/local environment settings back so that it works?

It seems that uninstalling and re-installing Anaconda was the easiest solution (after several hours of playing around with my PATH variables, etc).

This github thread shows the solution from spyder dev ccordoba12:
https://github.com/spyder-ide/spyder/issues/9951#issuecomment-517913824
run
conda install -f python.app
(Very fast to run)
Then spyder etc. was fixed. Apparently an incorrect python path in the launch script.
FYI I had this same issue with Anaconda install with python 3.8 (2022), after a big mess with upgrading anaconda via conda update --all. On MacBook Pro (Intel)

Related

pipenv Locking Failed when installing QuantLib-Python

I tried to create an environment in the folder quantengine (on my MacOS V.11.3 - Big Sur) by first installing the QuantLib-Python package. It seems to install, but I get the Locking Failed error. Any idea what might be causing this? I installed first pyenv via brew. I set Python 3.9.4 as global. I then installed pipenv via pip.
screenshot zsh shell

C:\Windows\system32>pip install pandasFatal error in launcher: Unable to create process using '"'

I have recently installed python-2.7.14 (32-bit) on windows 10. But when I try to install any package using command pip install XXX, it gives me above error.
I tried all solution to this existing problem but it didn't work for me.
My python is installed on C:\Python27
python -m pip install XXX
worked for me but when I tried to open jupyter notebook in windows command prompt by typing
jupyter notebook
It used to give me the same Fatal error.
Actually, it was my antivirus mcafee at organisational level which was blocking the exe to run.
To solve this I had installed python in D:\ folder.

Changing default Python from 2.7.10 to 3.5.2 in terminal so I can install pip

I was hoping for some help in setting up a Python development environment on a Mac.
Background: I'm running a newly upgraded macOS Sierra 10.12.1, and setting up various parts of Python development on it. This macOS version already came with Python 2.7.10 installed - and I'd prefer to leave that alone for now.
So I installed Homebrew, and then used that in turn to install the latest python3, that is, Python 3.5.2; but I guess it's not the default for Terminal yet, since when I run the python -V command, I get this in the Terminal window:
Python 2.7.10
So now I've got at least 2 version of Python on my Mac, and that's fine I guess, but the latest Python one is not the one that is the 'default'. How do I set 3.5.2 as my default rather than 2.7.10?
(Backstory for why I want to do that... pip is not installed, i.e., when I go to Terminal and type in pip, it says:
-bash: pip: command not found
When I tried to follow the installation instructions for pip, I ran into a permissions issue, which makes sense I guess, since I don't have access to the Mac's 2.7.10 Python install, nor do I really want it at this stage. So I'd like to switch Terminal to take the new Python 3.5.2 as my default one, in which case I guess I won't have pip permissions issues...)
Thanks in advance for any help folks!
The safest solution is to create a virtual environment running python 3 and use it as development environment. Check the following links:
https://docs.python.org/3/library/venv.html
http://docs.python-guide.org/en/latest/dev/virtualenvs/

Can't open a Python interpreter in Spyder 2.2.5 (Ubuntu 14.04)

A few weeks ago, I opened Spyder and found that I could not interact with the default Python interpreter console, which appeared greyed-out (screenshot below).
Consequently, I am not able to run Python scripts from within the IDE. I have tried rebooting my machine, opening new interpreters and IPython interpreters, but the result is always the same. I recently tried running spyder --reset in the terminal to erase my settings, but it did not help.
The only recent changes to my Python installation I made were in a virtualenv where I installed Python3, but I am not convinced this is related.
I had the same issue, also after updating packages. I solved the problem by updating Spyder:
sudo pip install --upgrade spyder

Fail to install Python 2.7.9 on a Windows google compute engine instance

I fired up a new Windows google compute engine instance. It's running Windows 2008 R2, service pack 1.
I download and try running the Python .msi installer for version 2.7.9, and it fails with this error:
There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.
I see this error for both the 64-bit and the 32-bit installer.
Has anyone else seen it or know of a work-around?
I reproduced your issue and I found two workarounds:
You can install python 2.7.6 successfully without further action.
If you need python 2.7.9 you can install it deselecting pip from the install menu.
This seems to be related to this answer in another thread although in that case the issue is with version 3.4.
Install python EXCEPT "pip"
Run the python install msi again and select "change"
Select "pip" and install the pip
It would be works...
I think it is a priority problem into the msi package...the package seems to try to install the pip before installing python.exe. So, pip can not be installed...
I'm using Windows 8.1 64-bit. I had 2.7.11 installed and then I tried to install PIP as well via Chocolatey PIP package.
I think my installation had got messed up because I had tried to install Python 3.4 as well as Python 2.
Then I had deleted all the Python 2 and Python 3 files in an attempt to get rid of this.
What worked for me was:
Editing the Environment Variables both, System and User to remove any PYTHONHOME or PYTHONPATH variables
I also deleted the path I had to python2 in the PATH environment variable
Now (as mentioned in Python Issue 22329) after deleting the Environment variables you can go into 'Programs and Features', click on the Python 2.7.11 (64-bit) program and then click 'Repair' - this then worked as I would expect without error.
Now finally I was able to go into 'Programs and Features', click on the Python 2.7.11 (64-bit) program and then click 'Uninstall'.
Edit: I assume this is connected with this PYTHON_HOME answer to a problem with Python 3.4
It seems to be a dependency issue, please try to install "Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)"