Switch from Python 3.4.2 to Python 2.7.1 OSX - python

I got an issue with my following demand. First of all i'm a total newbie, so please don't be too rude with me ;) I did install Python 3.4.2 along with PyCharm once (recommendation of a friend), but found a promising tutorial now, which recommends Python 2.7.1 badly, working with the Terminal and TextWrangler --> http://learnpythonthehardway.org/book/. Somehow i didn't figure out how to uninstall 3.4.2 or switch to 2.7.1, 'cause the terminal keeps saying i'm still in 3.4.2. I did some research in the web, but got really confused and couldn't find any matching issue to mine.

Although it can be confusing, you can have both a v2.x and a 3.x version installed on your system. If you have installed a python 2.7.1 after your python 3.4.2, you should be able to run your python 2.7.1, just type python2 in place of python.
Try out :
python --version
python2 --version
to check which version are installed.

Related

python cannot install tensorflow

My PC is 64 bit and python version is 3.7.9. I installed tensorflow as following. Does anyone know how to solve it? Let me know if further information is needed.
Edit:
I also tried anaconda as follow:
https://www.tutorialspoint.com/tensorflow/tensorflow_installation.htm
But the problem is that in anaconda prompt, I can import tensorflow. I use python in visual studio 2017. When I open python file in VS, it seems different with anaconda prompt. Do you know how to make it also work in VS?
The version of Python your using is too new for the version of TensorFlow your using.
If you go here: https://pypi.org/project/tensorflow/1.13.1/, and look on the left hand side and scroll down to "Programming Language", you will see the latest python version on that list is Python 3.6.
That is the cause of error your getting. You can either:
Switch to Python 3.6 or
Use TensorFlow 1.14.0 or above which supports Python 3.7
Also make sure your using the 64-bit version of Python. TensorFlow will not install if you have the 32-bit version of Python installed.
Could you try:
pip install --upgrade tensorflow

How to install pywinauto in python 2.5.1

I am not able to install pywinauto in python 2.5.1
Version 2.5.1 don't have pip.
I tried to copy paste pywinauto from 2.7.1 but didn't work.
from the pywinauto documentation
Installation
(Python 2.5 and before is not supported)
So it's time to upgrade. Python 2.5 now belongs to retrocomputing.
The latest pywinauto is not compatible with Python 2.5 because statements like except Exception as exc: won't work in Py2.5 (they are required for Py3.x compatibility and work for Py2.6+). Though you have chances with pywinauto==0.4.2 and before. 0.4.2 can be downloaded here (see "Releases" tab in the repo): https://github.com/pywinauto/pywinauto/archive/0.4.2.zip
You need to unpack it and run C:\python25\python.exe setup.py install

Matplotlib won't install properly on Python 3.5

I've just installed Python 3.5 to experience its functionality. The problem is that all the modules I use in my daily programming have been installed and run very well on it except Matplotlib. I installed it via pip and never faced any errors while installing, but when I wanted to import it, the error saying, DLL load failed: The specified module could not be found. popped up.
What's the matter with Python 3.5, or Matplotlib?
Uninstall the module using pip uninstall matplotlib then install it again using http://matplotlib.org/downloads.html
Obtain the .exe file that best fits your machine, in my case it would be matplotlib-1.4.3.win-amd64-py3.4.exe. This will be a more complete version of matplotlib for windows rather than using pip.
I would also consider rolling back to Python 3.4 unless you absolutely need 3.5. There shouldn't be a compatibility issue between 3.4 and 3.5 for Python, but as far as matplotlib it's been tested with 3.4, but if you run through problems on 3.5 I would roll back.
If you have Python 3.5 you should install MS's Redistributable DLLs to make matplotlib working on Windows... In my case, no need to reinstall matplotlib even...
Try this example without. If error appears install that and try with it (you must log in MS site and download version for arch you using - i tested x86 only, Windows 7, Python 3.5).
That case is included in matplotlib install documentation!
Remember, you should always read documentation before you ask!

Python version mismatch error while configuring the RBTools on mac osx

I was trying to configure the RBTools on mac os but i am facing an issue with setting up the repo.
This is the error am getting.
ImportError: Python minor version mismatch: The Mercurial extension modules were compiled with Python 2.7.5, but Mercurial is currently using Python with sys.hexversion=33949936: Python 2.6.8 (unknown, Mar 9 2014, 22:16:00) \n', '[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]\n', ' at: /usr/bin/python\n'
I have installed RBTools v0.7.4 with python version 2.6.8 and i have python version 2.7.5 as well.
This is the complete traceback http://pastie.org/10332044
Am getting this error when i try to run the rbt setup-repo.
Any help on this would be of great help am struck with this from past one week.
I think this is a bug in the RBTools assembly. I filed this ticket for it. See more details on how I troubleshot there, but specifically, go look at /usr/local/bin/rbt and change the shebang from python2.6 to python and you should be good.

Installing mechanize for python 3.4 on windows 8.1

How to install mechanize in python 3.4 on windows 8.1
I tried pip install mechanize
It had a few syntax errors in installation but finally it said Completed Successfully
Still import mechanize doesn't work
It says No module named 'mechanize'
From mechanize FAQ :
Which version of Python do I need?
Python 2.4, 2.5, 2.6, or 2.7. Python 3 is not yet supported.
But you could have a look to this other recent post from SO I get an error in python3 when importing mechanize if you want to test the version in developpement for python3.
By the way, did you try googling "mechanize python3" before asking on SO ?
If you have both python 2.X.Y and 3.z on your machine you will also have both pip and pip3 you may have installed machanize for python 2 rather than python 3.
Try:
pip3 install mechanize
try running
py -m install mechanicalsoup
it worked on my Windows 10 with Python 3.6
Good Luck

Categories