package context: unrecognized import path "context" (import path does not begin with hostname)

安装1.7以后的版本解决

如ubuntu:

下载

https://studygolang.com/dl

解压

Download the archive and extract it into /usr/local, creating a Go tree in /usr/local/go. For example:

tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

Choose the archive file appropriate for your installation. For instance, if you are installing Go version 1.2.1 for 64-bit x86 on Linux, the archive you want is called go1.2.1.linux-amd64.tar.gz.

(Typically these commands must be run as root or through sudo.)

路径加入搜索

Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:

export PATH=$PATH:/usr/local/go/bin

Note: changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.

 

当在PyCharm中出现错误信息"error loading package list: unrecognized windows sockets error: 5: co"时,这意味着PyCharm在加载软件包列表时无法识别的Windows套接字错误:5: co。 这个错误通常表示在PyCharm的运行环境中出现了套接字错误。套接字错误是指在进行网络通信时发生的一种错误。在Windows上,错误代码5通常表示权限问题。 解决这个问题的方法如下: 1. 以管理员权限运行PyCharm:右键单击PyCharm的快捷方式,选择“以管理员身份运行”,然后再次尝试加载软件包列表。这样做可以确保PyCharm具有足够的权限来执行所需的操作。 2. 检查防火墙和安全软件:某些防火墙和安全软件可能会阻止PyCharm的网络连接,导致套接字错误。检查你的防火墙和安全软件设置,确保PyCharm被允许进行网络通信。 3. 检查代理设置:如果你的计算机使用代理服务器进行网络连接,确保PyCharm的代理设置正确。在PyCharm的设置中找到“HTTP Proxy”和“HTTPS Proxy”选项,根据你的代理服务器设置进行配置。 4. 重新安装PyCharm:如果以上方法都没有解决问题,尝试重新安装PyCharm。卸载PyCharm后,下载最新版本的PyCharm并重新安装。 总结来说,当在PyCharm中出现"error loading package list: unrecognized windows sockets error: 5: co"错误时,可以尝试以管理员权限运行PyCharm、检查防火墙和安全软件、检查代理设置或重新安装PyCharm来解决问题。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值