关于anaconda+pycharm+解释器

  • anaconda使用
    • 创建虚拟环境,命令忘了hh
    • conda activate 虚拟环境(py39);输入python可以激活,此时可以看到python版本号
    • conda installpip install好,会帮你一并安装相关的依赖库
    • 装错了conda uninstall xxx
    • 改版本,比如说要装torch1.13.1但已经装了1.13.2,conda install torch==1.13.1 就好
    • 有时候安装不了,看报错要考虑用管理员打开的D: cd axian....
    • 配置源
      • 不知道安装过多少镜像conda config --show channels
      • 删除源
        • conda config --remove-key channels #删除所有的镜像源,恢复到默认
        • conda config --remove channels [urls] #删除指定的镜像源
      • 配置源
        • conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
        • conda config --set show_channel_urls yes
      • 以下也建议全部添加
        • conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
        • conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
        • conda config --set show_channel_urls yes
  • pip
    • conda listpip list 不互通,但有时候conda装不了pip能装,我也不懂
    • 更新pip python -m pip install --upgrade pip
    • 如果依赖很多pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
    • 下载cv2的whl(对应python版本)
      • 进一步cd到whl下的路径,pip安装xxx.whl
    • pip install torch超时
  • pycharm
    • 右下角add New Interpreter 添加解释器
      • 选第一个虚拟环境
      • 勾选Exis
      • 点击解释器右侧的三个点,找到conda虚拟环境,envs下的刚刚建py39下的python.exe
    • pycharm里面的Terminal终端下面pip或者conda是可以同步更新的

暂时只想到这些咯

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值