I'm unable to run a python console inside Eclipse. I've downloaded Pydev, set up an interpreter and a PYTHONPATH and imported a project, a Django project. I set up the project as a Django one and then I tried right click on the project-->Django-->shell with Django environment.
I got the following error in the console:
Error starting server with host: 127.0.0.1, port: 1349, client_port: 1350
ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x026EA210>
ERROR - failed to write data to stream: <pyreadline.console.console.Console object at 0x026EA210>
If I try to open a Windows shell and do the usual python manage.py shell all goes smooth so I guess I have some problem with the Eclipse configuration but I have no clue.
Thanks for your help
I figured it out the problem but I still have no solution. If I uninstall IPython the shell in Eclipse works correctly, of course I don't have IPython anymore though. If I reinstall IPython I lose all the functionality in my Eclipse Python shell while I have Python perfectly working in a Windows terminal. What Eclipse is doing???
I have same problem, this post help me:
installing IPython with two versions of Python (Windows)
I have win7. I think that problem is pyreadline library. If I updated to pyreadline-2.0-dev1.win32.exe, it is OK. Can be downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyreadline
I found it!! You don't need to uninstall Python or any other things, it is a problem entirely of Eclipse. Go here:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\eclipse\plugins\org.python.pydev_2.5.0.2012040618\PySrc
or if you have PyDev in a different location just search for the file
pydev_ipython_console
In that folder make sure you only have one such file. For example in my case I had:
pydev_ipython_console (py)
pydev_ipython_console (pyc)
pydev_ipython_console_010 (py)
pydev_ipython_console_010 (pyc)
Just deleting the first 2 made the console working properly and even installing IPython to have it on a Windows terminal didn't cause any problem with the Eclipse console
Related
I've gotten this to work relatively easy on my Mac I with django but for some reason Windows has been a heartache.
the problem is that in the console I can only get py to start executing python.
python and python3 do not work whatsoever
and also I can't get pip to install either because the py command won't execute it but python and python3 just open the windows store.
I've installed python to the path with the installer and I made the location of the file C:\Python\Python39
changed the hierarchy in the PATH in user variables and system variables to where python is at the top in both.
I've edited the vscode settings
I've also turned off the App execution aliases. That did nothing.
I'm at a complete loss so if any one has any advice I'd be so appreciative.
This tutorial helped me make pip working when I started programing
https://youtu.be/28eLP22SMTA
I'm working with VSCode on an Ubuntu 18.04 machine. Everything is fine except that I can't get back to the previous command in Python Interactive Window via Arrow Up. It works in the integrated terminal though, integrated shell is /bin/bash.
I have no idea where this is coming from. I changed "keyboard.dispatch" to "keyCode", but that's not the problem. I also tried different versions of the python-extension.
Do you have any idea?
Thanks!
Not sure if this is helpful for you as an Ubuntu user, but I came across the same problem in Windows this week. In my case, the issue cropped up after I installed the Python extension in VS Code (or at least I didn't notice the issue before this). The combination of using the Python extension, Git Bash for terminal, and python virtual environment killed the up arrow feature for me. Using python outside a virtual environment works fine. My solution was to use Command Prompt as the terminal when I wanted to use a virtual environment interactively.
In my situation, although I delete all the shortcuts of UpArrow, I still can get the previous command through UpArrow in Python interactive. This means there's no way to configure this shortcut, it was built in the plugin which built in Python extension.
So it's some problem with your Python extension, but you said you have tried to install a different version of Python extension but still not work. Make sure you have deleted it completely -> delete the extension folder manually(it's under C:\Users[UserName].vscode\extensions\ms-python.python-xxx).
"G:\Everything python\Scripts\python.exe" "C:/Users/dell/PycharmProjects/untitled8/python test.py"
No Python at 'C:\Program Files (x86)\Python38-32\python.exe'
Process finished with exit code 103
Everytime I try to make any sort of code in pycharm.Even something basic like print(1).I get hit with this code.I tried uninstalling and reinstalling python and pycharm but it didn't work.[Please Help]
In PyCharm, check File - Settings ... - Project - Project Interpretor. It's probably pointing to a location where you no longer have Python installed.
The reason this doesn't go away after a reinstall is because you probably didn't tell PyCharm to remove all previous settings. The reason this happens at all is because PyCharm supports (like any good Python IDE) multiple installations of Python and virtual environments.
I seem to have problem launching python from command line. I tried various things with no success.
Problem: When trying to run python from the command line, there is no response i.e. I do not get message about 'command not found' and console does not launch. Only option to open python console is to run C:\Python34\python.exe directly. Running using python command does not work even when in the python directory but python.exe launches. Issue with the launching this way is that python console is launched in new window. This whole problem is present only on one machine while on my other machine I am able to run python correctly and console launches in the command prompt window from which the python command was executed.
PATH is correctly set to
C:\Python34\;C:\Python34\Scripts;...
and where python correctly returns C:\Python34\python.exe. I verified that running other commands imported through PATH (such as javac) run correctly.
Things I tried:
Completely re-installing python both with x86 and x64 python installations with no success.
Copy installation from my second machine and manually set the path variables - again no success.
Can anyone hint how to resolve this behavior?
(Additional info: Win 8.1 x64, python 3.4.2)
Issue resolved. Since no feasible solution was found in 2 days, I decided to wipe all keys containing 'python' from registry as well as some files that were not parts of other programs. This resolved the issue after re-installing python.
If anyone finds the true cause of this misbehavior and other - less brutal - solution, please write it here for future reference.
Recent Python installer has option to add PATH.
If you didn't use it, you can register directory where python.exe is to PATH environment variable.
But I prefer py launcher. It may be installed via Python 3.3 or 3.4.
With it, you can start Python via py or py -3.4.
See https://docs.python.org/3/using/windows.html#python-launcher-for-windows
I have two versions of python installed on my mac running OSX Lion. The first is the default python version that ships with OSX and is found in /usr/bin/python. The version I want to use is the version I downloaded from python.org, and that is installed in /Library/Frameworks/Python.framework/Versions/2.7/bin/python. I want to use Eclipse and PyDev using the python.org version as the interpreter. So, in Eclipse, I go to preferences and set the version installed in /Library/Frameworks/Python.framework/Versions/2.7/bin/python to be the interpreter.
in a terminal window, if I type:
$ which python
I get "/Library/Frameworks/Python.framework/Versions/2.7/bin/python" because I set my $PATH accordingly (modified .bash_profile to permanently do so)
but if I run the following simple script in Eclipse:
import os
os.system("which python")
the script's output is "/usr/bin/python"
Things I have tried as suggested by other similar posts:
tried removing and re-adding the interpreter location
tried adding the /Library/.../package-sites to PYTHONPATH
Why isn't eclipse using the interpreter I explicitly tell it to use? Any help with this issue will be greatly appreciated!
The problem is that os.system('which python') will search for the python in the path, not the one where you're currently running (so, its output is correct).
What you want to use/check instead is sys.executable (this attribute will point to your currently running executable).
As for the wxPython issue, which error are you having? (probably another question in stackoverflow thought).
I think Eclipse is running the correct python. In your code when running under eclipse which python does not find the python running. Try
import sys
print sys.version
The issue here is that running a GUI app from the desktop/dock/folder does not load your .bash_profile and so which python does not find your change to the PATH. To change your path for GUI apps you need to edit ~/.MacOSX/environment.plist
I agree with Mark here. sys.version will be what eclipse uses to run your code. os.system("which python") will be python found in PATH that eclipse forwarded when running your code. Perhaps if you use PATH tweaks you should set environment variables for running code in Eclipse too.