Probelm with Spyder 4.01 and Python 2.7 - python-2.7

Spyder (4.1) does not work anymore with python 2.7 in Anaconda environnement.
When I launch spyder it does not open and I do not have any message.
If I launch spyder with python 3.8 it works.
conda environment :
What can I do?

Python 2 has officially been retired as one can see in PEP 373, but if it is necessary to use python 2 you could try using an older version of the spyder package. If you wish to use your code in the long-term it is highly advised to migrate necessary to python 3. I hope this helped

Related

How to install h5py for version 1.10

I am using tensorflow in a python module, which is called by a c++ file. I moved to a new computer, where I installed ros again. So it works on one computer, but not on the other. There I got the following error:
UserWarning: h5py is running against HDF5 1.10.0 when it was built against 1.10.4, this may cause problems '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple)
then I did:
pip2.7 uninstall h5py
pip2.7 install h5py==1.10.4
but then I get the following error:
No handlers could be found for logger "keyring.backend"
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement h5py==1.10.4 (from versions: 2.2.1, 2.3.0b1, 2.3.0, 2.3.1, 2.4.0b1, 2.4.0, 2.5.0, 2.6.0, 2.7.0rc2, 2.7.0, 2.7.1, 2.8.0rc1, 2.8.0, 2.9.0rc1, 2.9.0, 2.10.0)
ERROR: No matching distribution found for h5py==1.10.4
It seems like there is no 1.10.4 version. What should I do?
I have to use python2.7. Also if I just let the python2.7 script run, it works. Only in conjunction with ros I get this error. But I think I take the python version from the same folder.
Thank you

installing numpy on a python 2.7 with system windows 8.1

I'm working on a code to run it in abaqus. I need in my code to use numpy module. I have python 2.7.11 on my computer. I have installed it on windows 8.1.
I have downloaded numpy-1.11.Zip already.
I look for an easy detailed guide for installing it on my python
Thank You!
If you have pip installed on your system, execute
pip install numpy

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

link python version with ipython

I have two versions of python, namely 2.7 and 3.3. Each time I launch ipython it tells me
Python 3.3.4 (default, Feb 11 2014, 15:56:08)
How do I do to launch ipython with the python 2.7? I always use the ipython notebook, do I need also to change something in it?
You may have only installed IPython for Python 3 on your system. Arch uses Py3 by default, I believe, so when you installed the ipython package and its dependencies it was actually ipython3. Try installing the ipython2 package, along with its dependencies. Once completed, you will have a /usr/bin/ipython2 command for running IPython using Python 2.7.
However, before installing, double-check to see if /usr/bin/ipython2 exists. If it does, you're all set, and shouldn't need to install anything else.