QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb' - x11

I am using WSL in Windows 10. I have this warning getting displayed when I run a python file:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb'
I can understand that the XDG_RUNTIME_DIR environment variable is not set and it is creating its own path /tmp/runtime-aadithyasb
I am getting this warning from the moment I installed Xserver for Windows using VcXsrv to open plots when the file is ran.
Wy question is should I add this XDG_RUNTIME_DIR environment variable in windows or is there any method to set a directory under the variable for Ubuntu used under WSL?

I was able to find what the caused the terminal to issue the warning. Yet I am posting this so that it would be useful for people someday who are new to using WSL like me. This link helped me to solve it and gave me a better insight on how linux works under a WSL:
https://dev.to/winebaths/getting-up-and-running-with-the-windows-subsystem-for-linux-8oc
To solve this issue I just added the below lines to my .bashrc file:
export XDG_RUNTIME_DIR=/some/directory/you/specify
export RUNLEVEL=3
After this just run the command
source .bashrc
Now the warning will not keep displaying in your terminal.

Last week, I had a similar error installing a Orange3's library
My environment is:
Ubuntu 18.04
python3 (3.6)
orange3 (3.27.1)
pyQt5 (5.15)
The trouble was:
When I tried to compile orange3 in a command line:
sudo python3 -m Orange.canvas
The system showed:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'/home/rene/.local/lib/python3.6/site-packages/orangewidget/widget.py:287: RuntimeWarning: subclassing of widget classes is deprecated and will be disabled in the future.Extract code from OWBaseVectorizer or explicitly open it.RuntimeWarning)
Fault segment
The trouble for this system error was:
Orange3 (3.27.1) is not compatible with PyQt5 (5.15).
However, PyQtWebEngine will be compatible with a PyQt5 upper version to 5.12
I searched in internet the different versions of rhis library and I installed a version between 5.12 and 5.15
Thus, I did I had a downgrade of the PyQt5's library to 5.13.1:
pip3 install PyQt5 == 5.13.1 --use-feature = 2020-resolver
As result of this:
Orange3 compile again

I had this problem too just today. What I did was that I opened up PowerShell and killed Ubuntu WSL with the following command:
wsl.exe --shutdown
After that, I opened VcXsrv with its shortcut called "XLaunch" and made sure to tick off "Disable access control".

Related

conda: command not found even though Anaconda is in path (WSL)

I've tried/checked related posts but I can't find what's stopping my Windows Subsystem for Linux from running conda.
These paths (I have verified that they are correct and exist) are in my PATH.
/mnt/c/Users/user/Anaconda3:
/mnt/c/Users/user/Anaconda3/Library/mingw-w64/bin:
/mnt/c/Users/user/Anaconda3/Library/usr/bin:
/mnt/c/Users/user/Anaconda3/Library/bin:
/mnt/c/Users/user/Anaconda3/Scripts
Note that I added the new lines so that it is more readable, the spaces aren't actually present in my PATH.
When I run conda --version on command prompt I get conda 4.7.12, but I get this error when I run the same thing on Linux: conda:command not found
Also, I tried closing and opening my terminal and shifting the paths to the front of PATH (not that it matters but I was desperate), both didn't help.
Already referred to:
How to run Conda?
conda command not found even though path is exported
Anyone has any idea?

Cannot install lektor in pyenv virtualenv: `clang' exists in these (other) Python versions

I'm trying to install lektor into a new virtualenv using pyenv virtualenv. I have no problem making a new virtualenv with Python 3.7.0, but when I try to pip install lektor, I get a build failure with watchdog and the following error message:
pyenv: clang: command not found
The `clang' command exists in these Python versions:
anaconda3-5.0.0
error: command 'clang' failed with exit status 127
I understand that the anaconda3 version has clang, but I also have a version installed in /usr/bin. The output of which -a clang is:
$PYENV_ROOT/shims/clang
/usr/bin/clang
Can I manually set the shim to point to usr/bin? Or is there a different solution to this issue?
This is a rotten solution, but it does work. By taking the shim for clang and temporarily moving it (e.g., mv $PYENV_ROOT/shims/clang ~/Desktop), watchdog can be installed, then the clang shim can be moved back to the original location. A better option would be for pyenv to default to the system versions of programs if a shim doesn't point anywhere in a given environment…
Alternative solution
The pyenv plugin pyenv-which-ext takes care of this class of issues by checking for the existence of utilities in the normal $PATH after seeing that they aren't present in the current environment. It's a quick install via Homebrew, took care of all my issues.

cant use sudo, apt ,npm, etc in my vscode terminal even though I have Ubuntu bash installed on Windows 10

VSCode Version: 1.22
OS Version: Windows 10
explanation of issue:
I Entered something Basic Like sudo apt update or npm update inside my vscode integrated terminal and I get This Error Message:
bash: sudo: command not found
bash: npm: command not found
I Have the Ubuntu Bash installed on my windows 10 OS but inside my vscode terminal these commands dont work (even though they work inside the default terminal on my desktop).
How Can I fix this problem so I can strictly use the terminal in vscode and not a separate terminal, in order to save space on my screens?
This is explained in the documentation for VS Code (which has various options), but to avoid this being a link-only answer:
Set the "terminal.integrated.shell.windows" VS Code configuration variable to "C:\\Windows\\System32\\bash.exe" and you should be good to go.
For convenience, there's also a Select Default Shell command in the command palette which sets this for you.

Castlia 3.3 + omnetpp 4.6 on windows 7- permission denied

I have compiled both castalia and omnet and everything was right but
when running simulation using command line I got this error:
/c/Castalia/Simulations/radioTest$ ../../bin/Castalia
bash: ../../bin/Castalia: /usr/bin/python: bad interpreter: Permission denied
I installed python 2.6 in usr/bin path. but still has that error.
I tried #! usr/bin/env, but again I got same error.
how i can solve this problem?
In general Castalia is not supported under Windows, and any success people have running it is based on homebrews (custom solutions based on their configuration). The more reliable solution would be to run Ubuntu (perhaps on a virtual machine in Windows). Mac OS X works fine too.
Seeing your bash tag, I am not sure how you got to run bash on Windows (Cygwin?), but if you have a bash shell you can run which python to see where python resides on your system. If it's something other than /usr/bin/python then you can try changing the shebang line to the correct location. Or you can try #!/usr/bin/env python (notice the python executable after the path).
Also make sure you have the permission to run Python as the user you are logged in! How would you run any python script from command line?
Finally it is recommended that you have Python 2.7 installed, but it may run fine with 2.6 too.

Using Google App Engine SDK with Python 2.7 on Mac OS X 10.6

I need to run Python 2.7 on my Mac Snow Leopard, which has Python 2.6 installed. According to this answer, running the Python 2.7 mpkg installer from Python.org should get me there.
The reason I need to do this is that I'm trying to run the Google App Engine SDK for the Python 2.7 runtime.
After installing Python 2.7, I'm still getting the following warning in my GAE server log:
Warning: You are using a Python runtime (2.6) that is older than the
production runtime environment (2.7).
What else must I do to get the GAE SDK to recognize the new Python version?
EDIT 2:
Running:
$ sudo find / -name python2.7
I get:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7
According to the answers I went into GoogleAppLauncher -> Preferences and set the Python path to each of these, and each time I get the exact same error.
Running dev_appserver with the following flags:
--admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14
16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task
create for path '/Library/Frameworks/Python.framework/Versions/2.7'
failed: 22, "Invalid argument". Terminating temporary process.
Another Wierd thing is, it always tries to resolve to the same path, no matter which of those I plug in; It always reverts to /Library/Frameworks/Python.framework/Versions/2.7
EDIT 3:
OK, after entering the paths into the prefs field repeatedly, I finally just cleared it out, and somehow it's now pointing to the right place:
Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7
Open the GAE launcher preferences and set the Python Path option to the fresh installed Python 2.7, in your case /usr/local/bin/python2.7 .
Came across this question looking for a solution to the same dilemma regarding Mac, GAE and Python.
One comment I would like to make regarding setting the Python path using GAE Preferences. I notice you mention that you had a problem setting the Python path using the Preferences. I discovered that after editing the path, you have to press Enter. Otherwise, the path doesn't get updated. This might explain the weirdness you were mentioning when trying to edit the path field.
I installed python 2.7.x from macports. I see this:
$ python --version
Python 2.7.2
$ which python
/opt/local/bin/python
So, in the preferences for GoogleAppEngineLauncher.app I set the python path to:
/opt/local/bin/python
In the console log, I see this:
*** Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /opt/local/bin/python
I still see some errors about libraries, in particular Can't open zipfile...setuptools but simple stuff at least seems to work.
Good luck!
I am not sure if it helps, but instead of using the binaries from Python, I used MacPorts http://www.macports.org/ and installed the Python 2.7 runtime:
sudo port install python27

Resources