I have python3.4.0 installed on my system.
Today, I want to install python3.4.3, so I download the source code and install it.
However, my idle is still python3.4.0
while when I type python3 in terminal, it shows python3.4.3.
I also have pandas installed on my old version, it still can be used on my idle (linked with 3.4.0) but not with python3.4.3.
My question is how I can just sticked to python3.4.3 and make everything run in it.
I asked some questions in a comments. However, starting Idle with python3 -m idlelib will start Idle with whatever python is started with python3. Since you say that python3 starts 3.4.3, the above should run Idle 3.4.3.
Related
I've tried to setup windwos-curses as first step and it completes fine.
python -m pip install windows-curses
Also the following
python -m pip install bpython
does not show any problems.
Unfortunately running bpython results in a
ModuleNotFoundError: No module named 'fcntl'
Does it mean that bpython is not running on Windows 10 or is there another option for the installation here?
Found the solution on their github.
According to #509 Blessings doesn't work on Windows even with the custom curses library. We ought to update the Windows install instructions in the readme and on the site to say that bpython-curses needs to be run instead of bpython. We should also consider making bpython-curses the default on Windows
So, I'm running bpython-curses and it looks good to me (a few commands are not available though).
Unfortunately, there was a bug, namely it deletes the current line and returns back at the start of the history, when I type an underscore or a capital P, but it has been fixed now by Sebastian Ramacher.
Notice also that their home suggests to install an unofficial windows binary for pdcurses, but either way it confirms that you have to launch it by typing bpython-curses on your prompt.
I'm a beginner, I have really hit a brick wall, and would greatly appreciate any advice someone more advanced can offer.
I have been having a number of extremely frustrating issues the past few days, which I have been round and round google trying to solve, tried all sorts of things to no avail.
Problem 1)
I can't import pygame in Idle with the error:
ModuleNotFoundError: No module named 'pygame' - even though it is definitely installed, as in terminal, if I ask pip3 to install pygame it says:
Requirement already satisfied: pygame in /usr/local/lib/python3.7/site-packages (1.9.4)
I think there may be a problem with several conflicting versions of python on my computer, as when i type sys.path in Idle (which by the way displays Python 3.7.2 ) the following are listed:
'/Users/myname/Documents', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/myname/Library/Python/3.7/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages'
So am I right in thinking pygame is in the python3.7/sitepackages version, and this is why idle won't import it? I don't know I'm just trying to make sense of this. I have absoloutely no clue how to solve this,"re-set the path" or whatever. I don't even know how to find all of these versions of python as only one appears in my applications folder, the rest are elsewhere?
Problem 2)
Apparently there should be a python 2.7 system version installed on every mac system which is vital to the running of python regardless of the developing environment you use. Yet all of my versions of python seem to be in the library/downloaded versions. Does this mean my system version of python is gone? I have put the computer in recovery mode today and done a reinstall of the macOS mojave system today, so shouldn't any possible lost version of python 2.7 be back on the system now?
Problem 3)
When I go to terminal, frequently every command I type is 'not found'.
I have sometimes found a temporary solution is typing:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
but the problems always return!
As I say I also did a system reinstall today but that has helped none!
Can anybody please help me with these queries? I am really at the end of my tether and quite lost, forgive my programming ignorance please. Many thanks.
Try it with the problem1
I'm not an expert neither, but I think you need to install both in terminal and python in order to use the program.
python -m pip install pygame
You should actually add the export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" to your .bash_profile (if you are using bash). Do this by opening your terminal, verifying that it says "bash" at the top. If it doesn't, you may have a .zprofile instead. Type ls -al and it will list all the invisible files. If you have .bash_profile listed, use that one. If you have .zprofile, use that.
Type nano .bash_profile to open and edit the profile and add the command to the end of it. This will permanently add the path to your profile after you restart the terminal.
Use ^X to exit nano and type Y to save your changes. Then you can check that it works when you try to run the program from IDLE.
EDIT Replying to Rohan's comment here...
So I've tried import sys and sys.path for both in IDLE and in the terminal and the paths are different, not sure if that's where the problem is.
The code I'm trying to run is...
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
screen.fill((0, 255, 0))
pygame.display.flip()
pygame.time.wait(3000)
If I run the code in a terminal it works like it's supposed to, but I try it in IDLE it gets stuck on line with the Module Error.
CLOSE EDIT
I have searched through the already asked questions but couldn't find a solution to the issue I'm having. I have IDLE installed with Python 3.6.3.(if I type python3 in a terminal though I get Python 3.6.5) I've installed pip3 and the module pygame. However when I run my code I get the Module Not Found Error: No module named pygame.
If I run the code in the terminal directory everything works fine. So I thought I'd try another text editor Geany. After following all the instructions I can't even get Hello World to run on that. A terminal opens but freezes. The Compile and Execute lines were written exactly as they were supposed to be. I've tried updating and restarting my laptop but nothing works.
I'm just starting and following along with a couple books and everything has been going fine until this point but now I can't figure out what's going on. The only thing I can think of is IDLE only recognizes python 3.6.3, but if I type python3 into a terminal it says Python 3.6.5. I've tried updating and reinstalling IDLE but nothing seems to work. I can't even remove it. I haven't had any problems with code in IDLE until now and it's driving me crazy. Is there any way I can just reinstall everything and start it over fresh?
I apologize if this isn't written properly, it's my first post and the little guide on the right was covered up with some similar questions that aren't similar as I was reading it...
Question with no answers, but issue solved in the comments (…)
Answer from #Terry Jan Reedy in the comments:
It is unusual to have both 3.6.3 and 3.6.5 separately installed. If
pygame is installed for 3.6.5 (but not 3.6.3) and python3 in the
terminal starts 3.6.5, then python3 -m idlelib should start IDLE with
3.6.5 and code run with IDLE so started should be able to import pygame.
If the name of the file is pygame.py:
This file will be read/reached and NOT the pygame extension.
I'm using Windows 7 and am up to date on patches. I was using Python 3.5.2 and wanted to upgrade to 3.6, so I went to the Python site, downloaded 3.6.4.exe for Windows, and ran it. The Python seems to work fine and is 3.6.4, but trying to import any of the packages I was using (pandas, numpy, tensorflow, etc) now gives me ModuleNotFoundError: No module named <whichever module it was>. Also, pip list now shows only pip and setuptools.
It appears to be a known issue, for example this from nearly a year ago, which suggests that I should "uninstall the python bindings and install again", but I can't figure out what that means. Fortunately I can still access 3.5.2 by using py -3.5, and then my imports work. Can anyone tell me how to fix this for 3.6 without having to reinstall all my modules manually?
I was thinking possibly I should have upgraded through pip; it seems like that's possible but maybe a bad idea for some reason? On further investigation it looks like what I should have done was save my requirements with pip freeze > requirements.txt, and then after installing the new Python restore them with pip install -r requirements.txt. Is this right?
Hard to say if you have an install problem, but this is what I would try if I were in your place.
Create a virtual environment as per; docs
c:>c:\Python36\python -m venv c:\path\to\myenv
Activate your virtual environment
C:> \Scripts\activate.bat
Run your application from within your activated environment. Each time you get an import error, do a pip-install from within the active environment. (For your own modules, you may need to modify PYTHONPATH in 'activate.bat')
Once you have your application running again, do your pip freeze > requirements.txt, and keep that with your project.
Each time you run your application, do so from within the activated virtual environment.
This will give you a clean requirements.txt that doesn't include a bunch of junk from other projects. Then, when you go to 3.7, just create the virtualenv and run your requirements.txt and wala!
I suspect your issue is simply not running against the correct interpreter, running from within a virtual environment should at least rule it out.
I'm trying to install pybrain on python 3.2. It says here: https://github.com/pybrain/pybrain/pull/85 that it should work. However it does not for me.
I tried:
$export PYTHONPATH=$PYTHONPATH:'/home/luis/Documents/pybrain/'https://github.com/pybrain/pybrain/pull/85
which works well for python 2.7.
Did somebody get it to work?
After hours of "what the hell?!"s I installed it.
First the installer suggested is not updated for Python3 so I installed Distribute. With that installed I was able to use python setup.py install in the directory where I unrared pybrain. It gave a ton of errors. So I found this article (god bless google translate) and used 2to3 on pybrain directory. After I tried to install it again it gave an error on from string import split so I edited the file and removed that line (it is not needed really) and tried yet another time. This time no errors occurred and I was able to import pybrain without any problems. The same problem with the from string import split occurs in utilities.py again, so edit that line too.
I used 2to3 to turn examples to python3 too. benchmarkplots.py seems to work.
Update:
pybrain now supports python3
Here's how to install if you run into trouble
pip install https://github.com/pybrain/pybrain/archive/0.3.3.zip
Or just grab latest github pybrain release.