问题
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?
回答1:
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.
回答2:
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
Regards guys, thank you very much for you help and contribution
I hope that this comment will be a contribution for community
Rene
来源:https://stackoverflow.com/questions/59790350/qstandardpaths-xdg-runtime-dir-not-set-defaulting-to-tmp-runtime-aadithyasb