I have installed Tensorflow with Virtualenv in my Linux Mint 18.3 Xfce.
I have Pydev for Eclipse Neon and I have added a new python interpreter pointing to "bin/python" executable inside tensorflow virtualenv folder.
I am able to execute programs by selecting this interpreter, but when I open the interactive console and select the interpreter for tensorflow I get an error:
Error initializing console.
Unexpected error connecting to console.
Failed to receive suitable Hello response from pydevconsole. Last msg received: Console already exited with value: 1 while waiting for an answer.
I can't understand why this happens. For example I tried another IDE called Pyzo, configured the tensorflow interpreter and the interactive shell run without any problems.
Anyone has experienced the same issue?
Related
I have a WSL environment running python and venv.
Besides that I have VSCode running in Windows with AREPL
I have no problem accessing my python venv including pip modules using the VSCode terminal. AREPL however seems to fail to recognize my pip plugins. My guess is that AREPL is using the Windows Python version to run the code instantly. However the WSL python venv does not generate a python.exe I could point my AREPL interpreter to.
So my question is:
Can I run AREPL on Windows VSCode to validate code that requires PIP modules that are NOT installed in Windows, but are installed on WSL within a venv.
I've tried Changing AREPL Python Path to either Python venv, WSL or Windows Python:
"D:\Scripting\Python\venvs\automation\bin\python"
"C:\Windows\System32\wsl.exe" (nothing happens as I type)
"C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\python.exe" (generates error)
Error when using venv location:
Error in the AREPL extension!
Error running python with command: D:\Scripting\Python\venvs\automation\bin\python -u C:\Users\user\.vscode\extensions\almenon.arepl-1.0.16\node_modules\arepl-backend\python\python_evaluator.py
Error: spawn D:\Scripting\Python\venvs\automation\bin\python ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Are you sure you have installed python 3 and it is in your PATH?
You can download python here: https://www.python.org/downloads/
Error when using WSL:
Nothing happens
Error when using windows python:
Traceback (most recent call last):
line 1, in <module>
ModuleNotFoundError: No module named 'requests'
Maker of AREPL here! Sorry I didn't see this until recently, hopefully it will still be helpful. To use WSL python in windows vscode you can set your pythonpath to JUST wsl and your pythonoptions to ["python3", "-u"]. When you open it you will get ......
an error. Dang.
The problem is that the python-shell library I use uses path.join which joins the path to the arepl executor file with windows path separators, which doesn't work in WSL.
Instead of trying to run WSL python through windows vscode I suggest installing remote-wsl, opening a WSL vscode, installing the python and arepl extension there, and using that. I tested it and verified that it works.
Setup: MacOS High Sierra, Spyder 3.3.1, Python 2.7.15 64bits, Qt 5.9.4, PyQt5 5.9.2 on Darwin
I run the following code in the IPython console within Spyder:
In [1]: import os
In [2]: os.system("ls")
Out[2]: 0
In [3]: os.system("aasdasd")
Out[3]: 32512
I can see the output to stdout of the ls command in the bash shell where I run spyder, but not to stderr of the second os.system call that should print sh: asdasd: command not found.
Where does spyder redirect stderr to? Is there a way to see error messages like the one generated in the second case?
Thank you very much!
(Spyder maintainer here) This was fixed in spyder-kernels 0.3.0, the package that provides kernels for our consoles. And by fixed I mean that both stdout and stderr of external commands are now shown directly in our IPython consoles.
To update spyder-kernels, please close Spyder and run in a system terminal (xterm or Terminal.app, this doesn't work on Windows):
conda install spyder-kernels=0.*
if you use Anaconda (it's not available at the moment, but it should be shortly, please wait until it is), or
pip install spyder-kernels==0.*
if you use a custom Python installation.
I have a python file running perfectly in the IDE.
I want to run it on a different PC without any IDE.
I run the program from the command line: python program.py
Error message: File "program.py", line 8, in
from mpl_finance import candlestick_ohlc
ModuleNotFoundError: No module named 'mpl_finance'
When trying: pip install mpl_finance (or pip install mpl_toolkits)
I get the message: No matching distribution found for mpl_finance (or mpl_toolkits)
There also seems to be a problem with matplotlib backend.
Looking for a solution please.
After many failed paths, here's what worked:
matplotlib.finance is deprecated and it is now mpl_finance.
Create 2 files named mpl_finance.py and setup.py and get their contents from here.
Then from the command-line: python setup.py install
Fixing the backend (this can save you a few days):
If the backend of matplotlib was set in a file original PC (and not in the code). Then you need to do the same on the second PC.
Windows Path: C:\Program Files\Python36\Lib\site-packages\matplotlib\mpl-data\matplotlibrc
Change (probably line 38) to this: backend : Qt5Agg
I've seen a few instances of this question, but have not found a solution or explanation.
I downloaded the latest canopy express (canopy-1.5.2-rh5-64.sh) onto a 64 bit Ubuntu 14.04.1 installation. Ran the install successfully. I then attempted to execute canopy for the first time but received this error:
~/Canopy/canopy_cli setup ~/canopy
/home/barry/Canopy/bin/_python: 1: /home/barry/Canopy/bin/_python: ELF: not found
/home/barry/Canopy/bin/_python: 9: /home/barry/Canopy/bin/_python: Syntax error: ")" unexpected
I also tried executing from the canopy icon from the file browser which produced this file:
�##�C#8# (invalid encoding)
It appears that the _python executable cannot be executed due to invalid encoding.
Has anyone else encountered this with Ubuntu 14.04, and is there a work-around?
Most likely cause: trying to install 64-bit Canopy on 32-bit Linux.
What is the output of uname -m ?
See https://askubuntu.com/questions/361013/canopy-ide-unexpected-error
When I try to run my C++ hello world program in Eclipse, I get the error "Error while launching command: gdb --version".
SO won't let me upload the following screenshot: Screenshot 1
I'm running eclipse on Windows 7 and using Cygwin's GCC/GDB. Typing gdb --version in cygwin causes no problems. I've confirmed that it's in C:/cygwin/bin. This path is added as an environment variable. What's the problem?
Here's a screenshot of my path variable: Screenshot 2
This is be because Eclipse CDT does not support gdb version 7.5. Please try to install the gdb version 7.3, or older.