Background
I'm stuck at opening spyder on a remote Linux server which I access via x2Go from windows 10 via a secured connection from my university .I'm not familiar with Linux but my colleague set up an account for me, which worked fine until I needed an extra module that downgraded a lot of package, which I tried to solve by myself and messed up my system (using pip and reinstalling conda not knowing what I was doing, damn)
I have my user account home/bianca but my anaconda distribution has been reinstalled in media/bianca/software/anaconda3/ by my colleague. There is a spyder3 and a spyder4 in a new environment with
conda install -c conda-forge matplotlib=3.1 qt=5.6.2 spyder
as given here: Python spyder could not initialize GLX.
Problem
if I call spyder3 in my base env, no pop-up appears and I get the error
Could not initialize GLX
Aborted (core dumped)
--> looks like the communication of my windows and the linux via the xserver is wrong.
but
if I open spyder4 from a new environment, the spyder4 loading screen appears, blinks, then the program opens (where I can see my last scripts used some other time are being loaded) and crashes:
Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
Segmentation fault (core dumped)
Calling the default spyder of the system on some other disk there is no problem (but I don't have my modules)
From the terminal it all works
What I tried
delete all python paths
conda spyder --reset,
we deleted a lot of files in home/bianca
find some kind of initialisation file that stores the last opened
scripts (not found, is it in home/bianca/.config/spyder-py3?
Can it be that there is some erroneous link in there, can I delete that one?
Thanks very much for any suggestion, I'll gladly give more specifications!!
Bianca
I had the same issue, also using x2go. After trying everything that you tried, the only solution I found was to launch spyder in a different way. Before this, I would so as follows (and it worked perfectly):
source activate [name of your virtual environment]
spyder&
Since last week, the 'spyder&' command no longer launches the IDE, and I managed to surpass this by writing instead:
source activate [name of your virtual environment]
spyder3
The terminal still complains about certain issues, but at least I can work now!
Related
I am trying to install Python 2.7 (64 bit) on Windows 10. In the middle of the installation, a window pops up saying:
Error writing to file C:\Python27\pythonw.exe. Verify that you have
access to that directory
How can I resolve this issue and install Python?
This error is normally encountered when the installer does not have admin rights for the drive/folder you are installing to. I also noticed that you are installing to drive C:
Here are a couple of things for you to try.
Open the installer program by right-clicking, and then selecting "Run as Administrator".
Depending on how you have your PC set up you may not have permission to install on drive C:
If this is a work computer, talk to your IT department. Otherwise, seriously consider using different drives to keep your OS and your applications separated.
I encountered a similar issue while installing Python 2.7.11 on Windows 7 (64bit). Here is how I solved the error.
Note down the path mentioned in the error.
Do not close the error message. i.e. Do not press "Retry" or "Cancel", let it be there.
Go to the directory mentioned in step-1.
Try to create a new folder or text file in this directory.
You will get an error message saying "The Disc Structure is Corrupted and Unreadable". This is the real issue which is causing the Python installation to fail.
Run Command Prompt as an administrator and enter the command: Chkdsk \f C:
Either it will start checking the disc or it will ask you to select if you want to check disc next time you boot-up your machine. Select Yes and restart your machine.
A disc check will be performed, which may take 5-10 minutes.
Now you can install Python without any issue.
I had the same problem , this is how I solved the error :
click on cancel
go to c:\
create a new folder and call it python or python3
run the python install as administrator and choose the new folder that you just created
as directory where it should be installed
et voila !
Your Windows 10 version may not be activated. So many administrator features are locked in inactivated Windows10 version.
So try to open CMD in administrator mode and run following command to ignore the activation message.
slmgr -rearm
Now you can install fresh version of python with pythonw.exe features.
Right Click The running Uninstaller. Then Right Click Python 3.9.1 64-bit as shown below in the picture. ( I have Python 3.9.1. You can do it in any Uninstaller) Now it will repair without any errors. ^_^
For my current job it would be extremely helpful to be able to configure a virtualenv with the appropiate libraries versions, and be able to run either a python project, or cells in jupyter. This is because some people at my job work with jupyter, and some with Python, and sometimes both, and this way I would have a centralized program that could run both types, which I have not found outsaid of the paid version of PyCharm, which my company does not provide.
I just learned a few days ago about Windows Subsystem for Linux, WSL, and that it can be launched from withing Visual Studio Code, so I feel like this is my best bet to achieve that dual nature of programming from just ONE program, instead of running several like in the past.
As of right now, I have a repository cloned with WSL for a git project with different ".py" files, I open it with VSC, then open the terminal inside VSC, and I can both edit the Python code, and run it on the terminal, using bash commands as I would if I were in Ubuntu (I am doing all this from windows but can switch to Ubuntu if it would mean to be able to do this type of setup).
When I run with "Run Python file in terminal", it uses the virtualenv I have previously created.
The problem is, with Jupyter, it does not detect I have the libraries installed (like Pandas for example)
Description of my process with Jupyter so far: With the WSL console, I launch a jupyter notebook &. I then connect to that server, usin the VSC option for "Specify Local or Remote Jupyter server for connections", use the "Existing" option, copy the URL, then I go to the ".ipynb" file and start running code.
If, in a Jupyter cell, I do
import os
os.environ['VIRTUAL_ENV']
I can see my virtual enviroment. If right after that, I run import pandas I get ModuleNotFoundError: No module named 'pandas'
If I do !pip freeze I can see all the libraries and right versions that I have installed in that enviroment.
I feel like I am almost there but something is missing. My guess is that import might be going to some default installed Python, and not the one from the enviroment, for some reason I am missing.
Solved by doing what this answer suggests. The rest of answers may be of help, too:
https://stackoverflow.com/a/51036073/6028947
I installed Python 3.4.3 over 3.4.2 on Windows 7 and got problems with IDLE not starting.
When I use the Windows uninstaller via the control panel I get the message:
"There is a problem with this Windows Installer package a program required for this install to complete could not be run. Contact your support personnel or package vendor."
If I try to remove Python via the msi file then I get the same message.
There is no Python34 directory on my machine. I noticed that there is an entry in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.4\Modules. I didn't want to mess with my registry, but can I safely delete this entry? Is there any more to delete?
I used MicrosoftFixit.ProgramInstallUninstall and I was able to remove Python34 and then it reinstalled without any problems.
Had a similar problem. This is what I did:
Restart computer (kill any running processes of Python)
Delete the main Python folder under C drive.
Using CCleaner (or a similar application), use the Tools -> Uninstall feature to remove Python (if it is still there after deleting the folder)
Then go to the Registry window in CCleaner and clean the registry. Python should now be completely gone from your computer.
When setting up the remote interpreter and selecting Vagrant, I get the following error in PyCharm:
Can't Get Vagrant Settings: [0;31mThe provider 'virtualbox' that was requested to back the machine 'default' is reporting that it isn't usable on this system. The reason is shown bellow: Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed. Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires this to be available on the PATH. If VirtualBox is installed, please find the `VBoxManage` binary and add it to the PATH environment variable.[0m
Now, from a terminal, everything works. I can do 'up' and ssh into the VM without issues. Ports are forwarded as well as local files. So the issue is only in PyCharm. I have installed Java 1.8
PATH is: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
which VBoxManage: /usr/local/bin/VBoxManage and works in terminal.
Note that this is a fresh install of OS X done this morning.
Vagrant version is 1.7.3, VirtualBox is 4.3.30 and PyCharm is 4.5.3
Another workaround:
sudo ln -s /usr/local/bin/VBoxManage /usr/bin/VBoxManage
Edit:
Since it all worked some time ago, one of the following has to be cause of this problem:
either update of VirtualBox changed location of it's executable
or update of PyCharm changed PATH settings / executable location expectation for the IDE
Whatever the cause is, the solution is to make sure VBoxManage is in location expected by PyCharm. I haven't make up this solution myself, just googled it, but because it is so nice and clean I decided to add it here.
Turns out, this problem is a known bug in PyCharm.
Until they fix it, you can get around the problem by launching PyCharm from a terminal window with the charm command.
Vagrant 1.7.3 and VirtualBox 4.3.30 under Pycharm 4.5: Path issue
This helped me solve the issue:
https://github.com/Parallels/vagrant-parallels/issues/184
I can call this command where my vagrant file was located:
vagrant plugin update vagrant-parallels
Also, this link added some help for python paths
How to configure custom PYTHONPATH with VM and PyCharm?
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