图像系统-环境搭建及运行

155 阅读2分钟
  • 问题一:

ERROR: Could not find a version that satisfies the requirement numpy==3.8.13 ,ERROR: No matching distribution found for numpy==3.8.13

解决:使用的是特定的Python环境(如virtualenv或conda),确保在正确的环境中安装numpy,如conda,使用conda install numpy=3.8.13

  • 问题二:

The environment variable ‘Path’ seems to have some paths containing the ‘"’ character. The existence of such a character is known to have caused the Python extension to not load. If the extension fails to load please modify your paths to remove this ‘"’ character.

解决: 1.这里的 " "指的是环境变量存在引号,这里可以通过启动cmd命令提示符,输入命令path查看。

2.系统Path环境变量,将合并在一起的路径拆分成单个的,分别新建一栏存放,然后点击确定,重启VSCode即可。

  • 问题三:要在某环境比如base中安装numpy包,首先要先切换到该环境C:\Users\liuyi>conda activate base,再安装该包。
  • 问题四:

C:\Users\liuyi>pip install numpy -i pypi.douban.com/simple --trusted-host pypi.douban.com Looking in indexes: pypi.douban.com/simple ERROR: Could not find a version that satisfies the requirement package_name (from versions: none) ERROR: No matching distribution found for package_name

解决:更换镜像源

1)mirrors.aliyun.com/pypi/simple… 阿里云
2)pypi.mirrors.ustc.edu.cn/simple/ 中国科技大学
3)pypi.douban.com/simple/ 豆瓣
4)pypi.tuna.tsinghua.edu.cn/simple/ 清华大学
5)pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学

  • 问题五:

vscode连接远程服务器,默认配置文件没有端口,需加上端口才可以连接成功。

密钥连接,公钥放到服务器ssh文件夹中,注意ssh文件夹在目标服务器路径。也可手动复制公钥到目标服务器ssh文件夹中。

  • 问题六:

终端运行app.py,需切换到app.py所在文件夹,再conda activate cnclip(当前解释器名)。

终端:

`Running on local URL: http://0.0.0.0:7860

To create a public link, set share=True in launch().`

app.py中launch()函数:

demo.launch(
    auth=("admin", 'admin'),
    server_name='0.0.0.0',
)

0.0.0.0为默认ip地址,需更改为服务器实际ip地址,才可在浏览器运行。

其中admin,admin为登录账户密码。

  • 其他:
  1. vs code中 ctrl+或-可以调节界面大小。
  2. ls命令,可以查看当前文件夹下有哪些文件/文件夹。