我正在尝试使用适用于 Linux 的 Windows 子系统,并尝试使用 Matplotlib 创建 python 绘图。但我收到以下错误
RuntimeError: Invalid DISPLAY variable
Run Code Online (Sandbox Code Playgroud)
echo DISPLAY什么也没显示。我该如何设置DISPLAY变量?
stackoverflow 上似乎有很多类似的问题,但似乎没有一个对我有帮助。我正在我的 Windows Linux 子系统上运行 Ubuntu 并尝试安装和使用 postgresql。
我是这样安装的:
sudo apt-get install postgresql postgresql-contrib postgresql-client
pgadmin3
Run Code Online (Sandbox Code Playgroud)
效果很好:
安装日志底部附近显示:
Creating new cluster 9.5/main ...
config /etc/postgresql/9.5/main
data /var/lib/postgresql/9.5/main
locale C
socket /var/run/postgresql
port 5433
update-alternatives: using /usr/share/postgresql/9.5/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
invoke-rc.d: could not determine current runlevel
Setting up postgresql (9.5+173) ...
Setting up postgresql-client (9.5+173) ...
Setting up postgresql-contrib-9.5 (9.5.8-0ubuntu0.16.04.1) ...
Setting up postgresql-contrib (9.5+173) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) …Run Code Online (Sandbox Code Playgroud) 我最近通过 WSL 在 Windows 上安装了 Bash。
但是,当我尝试使用 SSH 访问我的学校服务器以进行我的项目时(就像我通常使用 PuTTY 一样),每当我尝试通过 SSH 进入我的学校网络时,我都会收到以下错误消息:
我输入的命令是:
ssh username@schooldomain.edu.com
Run Code Online (Sandbox Code Playgroud)
我收到的错误消息是:
Could not resolve hostname schooldomain.edu.com: Temporary failure in name resolution
Run Code Online (Sandbox Code Playgroud)
由于我对 UNIX 系统相当陌生,我可能错过了某些配置步骤。也就是说,我可以使用 PuTTY 访问学校的服务器。如果我可能需要进行任何其他配置才能使其正常工作,请提出建议。
谢谢各位!
运行命令bash或ubuntu在 PowerShell 中时,会输入 Windows-Subsystem-for-Linux,但是,PowerShell 的当前工作目录不会传递到 BASH。有没有办法实现这个功能?
我正在将 VS Code 与 WSL 一起使用。要在 WSL 中编辑代码,我需要导航到 WSL 中的目录,然后code .在同一目录中键入以打开 VS Code。它以前可以工作,但突然间我无法使用此命令。我收到错误zsh: command not found: code。
我尝试过的事情:
我启动并运行了 WSL2。在 Windows 级别我安装了 node.js,现在我想npm install snowflake-sdk从 Ubuntu 级别运行。-bash: /mnt/c/Program Files/nodejs/npm: /bin/sh^M: bad interpreter: No such file or directory当 PowerShell 工作正常时终端返回。
问题是:是否可以使用 WSL2 的终端与 Windows 级别安装的应用程序进行交互?
terminal powershell node.js snowflake-cloud-data-platform windows-subsystem-for-linux
我正在尝试 WSL 2,也在尝试 Vagrant。我在 Ubuntu 20.04 中使用它并且它工作正常,但现在我在 Windows 10 的 WSL 2 中遇到了问题。我的问题可能是关于 WSL 上的 SSH 问题,似乎127.0.0.1:222无法连接到 Virtual Box 中的图像. 如果我的理解有误,请纠正我
涉及的技术版本
流浪文件
Vagrant.configure("2") do |config|
config.vm.box = "base"
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
config.vm.define "laravel_envoy" do |laravel_envoy|
laravel_envoy.vm.hostname = "192.168.12.12"
laravel_envoy.vm.box = "bento/ubuntu-18.04"
laravel_envoy.vm.network :private_network, ip: "192.168.12.12"
laravel_envoy.vm.provider "virtualbox" do |bionicv|
bionicv.memory …Run Code Online (Sandbox Code Playgroud) virtualbox vagrant vagrant-provision windows-subsystem-for-linux
在 WSL2 中使用 VSCode。一切都很好,直到上周。从今天开始,我观察到启动 WSL 需要时间。以下是来自 VSCode 的日志。
[2021-02-22 06:00:31.458] Resolving wsl+myubuntu2004, resolveAttempt: 1
[2021-02-22 06:00:31.553] Starting VS Code Server inside WSL (MyUbuntu2004)
[2021-02-22 06:00:31.553] Extension version: 0.53.4, Windows build: 18363. Multi distro support: available. WSL path support: enabled
[2021-02-22 06:00:31.553] No shell environment set or found for current distro.
[2021-02-22 06:00:31.657] Probing if server is already installed: C:\Windows\System32\wsl.exe -d MyUbuntu2004 -e sh -c "[ -d ~/.vscode-server/bin/622cb03f7e070a9670c94bae1a45d78d7181fbd4 ] && printf found || ([ -f /etc/alpine-release ] && printf alpine-; uname …Run Code Online (Sandbox Code Playgroud) visual-studio-code windows-subsystem-for-linux vscode-remote wsl-2
尝试git-bash使用 canonical访问准备好的 git repo git,我得到:
$ git pull
fatal: Unsupported SSL backend 'schannel'. Supported SSL backends:
gnutls
Run Code Online (Sandbox Code Playgroud)
在WSL 下使用 Git Bash之后,我完成了git config http.sslBackend openssl:
$ git config http.sslBackend
openssl
$ git config --global http.sslBackend
openssl
Run Code Online (Sandbox Code Playgroud)
按照reddit 的提示,我已经完成了:
sudo apt install -y gnutls-bin
# and here are my installed packages:
ii gnutls-bin amd64 GNU TLS library - commandline utilities
ii libcurl3-gnutls:amd64 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libgnutls-dane0:amd64 amd64 …Run Code Online (Sandbox Code Playgroud) windows-subsystem-for-linux ×10
ubuntu ×3
powershell ×2
wsl-2 ×2
bash ×1
docker ×1
git ×1
linux ×1
node.js ×1
postgresql ×1
snowflake-cloud-data-platform ×1
terminal ×1
vagrant ×1
virtualbox ×1