When trying to open a interactive console on pydev I get an error:
Error initializing console.
Unexpected error connecting to console.
Failed to recive suitable Hello response from pydevconsole. Last msg
received: HTTP server returned unexpected status: Service Unavailable
Command Line used: D:\activestate\python.exe -u
D:\Boulot\pydev\eclipse\plugins\org.python.pydev_3.3.3.201401272249\pysrc\pydevconsole.py
51203 51204 51203 51204
Eclipse:
Version: Kepler Service Release 2
Build id: 20140224-0627
Pydev:
PyDev for Eclipse 3.3.3.201401272249
Java:
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Any idea how to make it work?
Try following:
In Eclipse under Window/Preferences/General/Network Connections:
--> set Active Provider: Manual
--> check in the box "Proxy bypass" if localhost and 127.0.0.1 are checked
Click Apply and try to open again.
That worked for me
As documented here, the solution is to update IPython
workon project
pip install -U ipython
I was having the same problem and fixed it with this.
(My solution is inspired by #Sala's answer. And I want to add more reasoning here.)
The root cause for my problem is, pydev console is hosted on localhost/127.0.0.1 and I have configured a proxy in my system. So my eclipse tried to visit it via a proxy but my proxy cannot find it since it is not a valid public address.
With #Sala's solution, one working configuration is like below. It essentially prevents eclipse from using the system (i.e. native) proxy.
And you should notice that in the Proxy bypass area, the Provider for localhost and 127.0.0.1 is Manual. Just in consistent with the Proxy entries area.
But what if you do want to use proxy? You need to bypass your native proxy for pydev console.
You can do it in IE -> Internet Options -> Connection -> LAN Settings -> Advanced:
Then, you don't nee to restart your eclipse, and you will see the Provider for the bypassed localhost and 127.0.0.1 has changed to Native now as shown below:
Now the pydev console should be able to start.
Related
I am trying to create a project using PyDev in Eclipse Oxygen, and whenever I start typing, Eclipse stops responding. It doesn't seem to be because of the completion, it works fine in Java projects and it's able to suggest import and other keywords. I'm typing a for loop when it freezes, I get about half way through the range keyword usually. I've restarted Eclipse several times and tried Java without issues. I'm running Java 1.8.0_144, Python version 3.6.2, and Eclipse version 4.7.0.
Any suggestions would be appreciated.
In the log file, this is the most recent error:
java.lang.RuntimeException: Attempt: 4 of 5 failed, trying again...(socket connected: still null) at org.python.pydev.core.log.Log.log(Log.java:54) at org.python.pydev.editor.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:353) at org.python.pydev.editor.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:232) at org.python.pydev.editor.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:165) at org.python.pydev.editor.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:222) at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.createTokensFromServer(CompiledModule.java:372) at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.<init>(CompiledModule.java:176) at org.python.pydev.editor.codecompletion.revisited.SystemModulesManager.getBuiltinModule(SystemModulesManager.java:332)
at org.python.pydev.editor.codecompletion.revisited.SystemModulesManager.getModule(SystemModulesManager.java:371)
at com.python.pydev.analysis.additionalinfo.AbstractAdditionalDependencyInfo.updateKeysIfNeededAndSave(AbstractAdditionalDependencyInfo.java:256)
at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:160)
at com.python.pydev.analysis.system_info_builder.InterpreterInfoBuilder.syncInfoToPythonPath(InterpreterInfoBuilder.java:86)
at org.python.pydev.editor.codecompletion.revisited.SynchSystemModulesManager.synchronizeManagerToNameToInfoPythonpath(SynchSystemModulesManager.java:390)
at org.python.pydev.editor.codecompletion.revisited.SyncSystemModulesManagerScheduler$SynchJob.run(SyncSystemModulesManagerScheduler.java:261)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Check the faq on that: http://www.pydev.org/faq.html#HowToFixCodeCompletion
As a note, the problem is that PyDev is not being able to connect to a shell for getting code-completion info. The usual culprit is some firewall blocking or a misconfigured localhost -- you may want to try to return 127.0.0.1 in the get_localhost() method in plugins\org.python.pydev\pysrc\_pydev_bundle\pydev_localhost.py or maybe ::1 if using ipv6 (if that fixes it for you or if you find a different solution, please let me know -- from time to time I see some different issue and I want to keep the faq updated regarding things still not explained there or update the code to workaround different issues).
You should check whether local socket connections are allowed in your firewall settings. You might even try to switch off the firewall to test if freezing still occurs. If not (or if you are on a machine with inet connection) you may allow local socket connections like this (and/or ipv6 equivalent):
iptables -I INPUT 1 -p all -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT
Be aware that this allows all localhost communication attempts, if unsure check back with your administrator. If this solves your problem and there arise no other security issues, persist the changes with (OS dependent - on a Windows / OS-X System you want to use the appropriate administrative GUI)
/etc/init.d/iptables save
The issue I'm facing right now:
I deploy Python code on a remote host via SSH
the scripts are passed some arguments and must be ran by a specific user
the PyCharm run/debug configuration that I create connects through SSH via a different user (can't connect with the user that actually runs the scripts)
I want to remote debug this code via PyCharm...I managed to do all configuration, I just get permission errors.
Are there any ways on how I can run/debug the scripts as a specific user (like sudo su - user)?
I've read about specifying some Python Interpeter options in PyCharm's remote/debug configuration, but didn't manage to get a working solution.
If you want an easy and more flexible way to get into the PyCharm debugger, rather than necessarily having a one-click "play" button in PyCharm, you can use the debug server functionality. I've used this in situations where running some Python code isn't as simple as running python ....
See the Remote debug with a Python Debug Server docs for more details, but here's a rough summary of how it works:
Upload & install remote debugging helper egg on your server (On OSX, these are found under /Applications/PyCharm.app/Contents/debug-eggs)
Setup remote debug server run configuration: click on the drop-down run configuration menu, select Edit configurations..., hit the + button, choose Python remote debug.
The details entered here (somewhat confusingly) tell the remote server running the Python script how to connect to your laptop's PyCharm instance.
set Local host name to your laptop's IP address
set port to any free port that you can use on your laptop (e.g. 8888)
Now follow the remaining instructions in that dialog box: copy-paste the import and pydevd.settrace(...) statements into your code, specifically where you want your code to "hit a breakpoint". This is basically the PyCharm equivalent of import pdb; pdb.set_trace(). Make sure the changed code is sync'ed to your server.
Hit the bug button (next to play; this starts the PyCharm debug server), and run your Python script just like you'd normally do, under whatever user, environment etc. When the breakpoint is hit, PyCharm should drop into debug mode.
I have this (finally) working with ssh RemoteForward open, like so:
ssh -R 5678:localhost:5678 user#<remotehost>
Then start the script in this ssh session. The python script host must connect to localhost:5678 and of course your local pycharm debugger must listen to 5678
(or whatever port you choose)
I am using pycharm (v4.5.3) and the pyramid web framework (v1.5.7).
I created a simple project, but I got an error when I tried to access the welcome page (that is in my case 0.0.0.0:6543).
Here are the steps I followed:
Installed python 3.4.3 and pycharm 4.5.3 (professional edition)
Created a project with pycharm (without creating an env because of the pro edition)
Selected scaffold "starter" and no template language because I read that could cause an error
Using pycharm GUI I ran "setup.py develop". The server starts at 0.0.0.0:6543 but the connection does not work. According to a video I watched on Youtube, a welcome page should appear. Indeed it appears only if I type "localhost:6543"; however my server is listening on 0.0.0.0:6543.
Can anyone help me?
0.0.0.0 is a "meta address" which tells the server to listen on all available local interfaces. This address is non-routable, so you can't access the server by specifying this address - you need a real IP of one of your machine's network interfaces
Starting today for no discernible reason, Pycharm's remote console function will not connect with my remote server.
All other functions are working as normal, SSH session, deployment config, skeletons update, file sync etc.
I am running Pycharm 4.5.3 on Windows7x64 against a remote server running Centos6.5x64 on AWS, note that this setup has been working fine for months until today.
The following output appears in the console window when remote console is launched, it takes a minute or so to timeout:
sftp://user#FQDN:22/home/user/Envs/lab1/bin/python2.7 -u /home/user/.pycharm_helpers/pydev/pydevconsole.py 0 0
Couldn't connect to console process.
Process finished with exit code -1
Unhelpful Log output(C:\Users\user\.PyCharm40\system\log\idea.txt):
2015-07-09 17:15:07,910 [ 236325] INFO - esdk.transport.JschExecProcess - Executing ssh command: env "PYTHONIOENCODING"="UTF-8" "JETBRAINS_REMOTE_RUN"="1" "IPYTHONENABLE"="True" "PYTHONUNBUFFERED"="1" /home/user/Envs/lab1/bin/python2.7 -u /home/user/.pycharm_helpers/pydev/pydevconsole.py 0 0 for user#FQDN:22
The following troubleshooting steps have yielded nothing: Workstation / Server, reboot, Fresh Virtualenv, Different version of Python, reinstall of iPython, uninstall of iPython, reset of console / deployment configuration, connecting from a different workstation running same version of Pycharm, upgrade Pycharm from 4.5.2 to 4.5.3.
Suggestions for further troubleshooting steps gladly welcome while I wait for Jetbrains support to get around to my ticket!
The problem was within the security configuration on AWS.
My AWS instance has a friendly FQDN to go with the unfriendly AWS internal name, which appears to cause some havoc with the way their NAT works if you don't have a rule allowing traffic from the IP bound to the FQDN back into the server.
I created the issue yesterday when my office router reset to a new IP - I must've overwritten the recursive rule with the rule allowing my new office IP into the instance.
So, add a rule allowing the server public IP for all traffic and Pycharm connects again when pointed at the FQDN.
I have just installed GAE launcher and am trying to run a sample application to make sure it works and I am getting the below error.
raise BindError('Unable to bind %s:%s' % self.bind_addr)
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind localhost:8000
2014-03-24 10:54:54 (Process exited with code 1)
I am trying to run the python version of the app with python 2.7 and am using windows 8.1 operating system. I did not create any files for the app, I just created a new application and am trying to run it in localhost.
Can someone please tell me what this error means and how to fix it?
The app server starts two servers: one for your application, the other for development console.
Change the ip address for the development console with:
dev_appserver.py --admin_port=9000
Another process is already bound to port 8000. Use netstat -an or netstat -anb or similar to investigate. It may be another instance of your development server.
Edit: If port 8000 is really occupied, Command-line arguments in the The Python Development Server says you can append --admin_port to change the 8000 to another free port.
For me, I have to use both --admin-port and --port
dev_appserver.py --admin_port=9000 --port=9999 app.yaml
I hope it might help others using PyCharm to understand where to set the admin port to something different than 8000.
Go to your "Run/Debug configurations" and in the configuration tab, add the following into "additional options":
--admin_port=9000