python

关注公众号 jb51net

关闭
首页 > 脚本专栏 > python > 升级anaconda python版本

升级anaconda中python到3.10版本的简单步骤

作者:Oo_Amy_oO

anaconda是一个非常好用的python发行版本,其中包含了大部分常用的库,下面这篇文章主要给大家介绍了关于升级anaconda中python到3.10版本的简单步骤,需要的朋友可以参考下

需要使用函数pairwise,发现python版本偏低,尝试了把anaconda中jupyter notebook中的python环境升级到3.10。

步骤如下:

在Anaconda Prompt中依次执行以下命令:

# 更新conda环境
conda update conda
# 更新anaconda环境
conda update anaconda

为了避免对现有环境产生影响,创建一个新的虚拟环境安装python3.10。执行以下命令创建一个名为python3.10的虚拟环境:

# 创建环境
conda create -n python3.10 python=3.10

# 激活虚拟环境
conda activate python3.10

安装Python3.10

# 安装python3.10
conda install python=3.10
# 激活3.10版本
conda activate python=3.10

在base下查看当前conda环境配置

conda info --envs

如果显示python3.10环境,那么python3.10就安装成功了。

回到anaconda要在左侧list中的environment环境中进行配置,将之前的环境更换为python3.10,就可以使用了。

附:Anaconda创建python3.10环境 ,pip报错:ImportError: DLL load failed while importing _ctypes: 找不到指定的模块。

一、问题

> pip
Traceback (most recent call last):
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\Scripts\pip-script.py", line 6, in <module>
    from pip._internal.cli.main import main
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\cli\main_parser.py", line 9, in <module>
    from pip._internal.build_env import get_runnable_pip
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\build_env.py", line 19, in <module>
    from pip._internal.cli.spinners import open_spinner
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\cli\spinners.py", line 9, in <module>
    from pip._internal.utils.logging import get_indentation
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\utils\logging.py", line 29, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\utils\misc.py", line 43, in <module>
    from pip._internal.locations import get_major_minor_version
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\locations\__init__.py", line 14, in <module>
    from . import _sysconfig
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\locations\_sysconfig.py", line 11, in <module>
    from .base import change_root, get_major_minor_version, is_osx_framework
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\locations\base.py", line 9, in <module>
    from pip._internal.utils import appdirs
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_internal\utils\appdirs.py", line 13, in <module>
    from pip._vendor import platformdirs as _appdirs
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_vendor\platformdirs\__init__.py", line 44, in <module>
    PlatformDirs = _set_platform_dir_class()  #: Currently active platform
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_vendor\platformdirs\__init__.py", line 23, in _set_platform_dir_class
    from pip._vendor.platformdirs.windows import Windows as Result
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\site-packages\pip\_vendor\platformdirs\windows.py", line 3, in <module>
    import ctypes
  File "D:\Users\tangtang1600\Anaconda3\envs\automatic1\lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: DLL load failed while importing _ctypes: 找不到指定的模块。

二、解决方案

conda install python=3.10

总结

到此这篇关于升级anaconda中python到3.10版本的文章就介绍到这了,更多相关升级anaconda python到3.10内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

您可能感兴趣的文章:
阅读全文