如何在anaconda下的Mac上安装pandas 1.1.0并在“解决环境”中挂起conda

马特·格

当我尝试时:

% conda update pandas
Collecting package metadata (current_repodata.json): done
Solving environment: | 

Updating pandas is constricted by 

anaconda -> requires pandas==1.0.5=py38h959d312_0

If you are sure you want an update of your package either try `conda update --all` or install a specific version of the package you want using `conda install <pkg>=<version>`

done

# All requested packages already installed.

堆栈溢出的答案表示尝试:

conda install -c conda-forge pandas==1.1.0

但这只是挂起:

% conda install -c conda-forge pandas==1.1.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: | 

如下所示,我可以使用以下命令安装旧版1.0.5的熊猫

conda install -c anaconda pandas

所以我想我的环境似乎运行正常...我只是无法从conda-forge安装1.1.0版的Pandas

% conda install -c anaconda pandas
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /opt/anaconda3

  added / updated specs:
    - pandas


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2020.6.24  |                0         132 KB  anaconda
    certifi-2020.6.20          |           py38_0         159 KB  anaconda
    conda-4.8.5                |           py38_0         3.1 MB  anaconda
    openssl-1.1.1g             |       h1de35cc_0         3.4 MB  anaconda
    pandas-1.0.5               |   py38h959d312_0         9.8 MB  anaconda
    ------------------------------------------------------------
                                           Total:        16.6 MB

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates                                 pkgs/main --> anaconda
  certifi                                         pkgs/main --> anaconda
  conda                                           pkgs/main --> anaconda
  openssl                                         pkgs/main --> anaconda
  pandas                                          pkgs/main --> anaconda


Proceed ([y]/n)? y


Downloading and Extracting Packages
openssl-1.1.1g       | 3.4 MB    | ################################################################################################################################################################################################ | 100% 
pandas-1.0.5         | 9.8 MB    | ################################################################################################################################################################################################ | 100% 
certifi-2020.6.20    | 159 KB    | ################################################################################################################################################################################################ | 100% 
conda-4.8.5          | 3.1 MB    | ################################################################################################################################################################################################ | 100% 
ca-certificates-2020 | 132 KB    | ################################################################################################################################################################################################ | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

我尝试了Anaconda Navigator,但是当我选择要升级的“ pandas”并单击“应用”时,会出现一个窗口,指出以下软件包将被修改,但该窗口为空。该窗口中的“应用”按钮被禁用,因此我认为它没有做任何事情:Anaconda Navigator的屏幕截图未更新熊猫

我可以通过pip升级到pandas 1.1.3:

% pip install pandas --upgrade
Collecting pandas
  Downloading pandas-1.1.3-cp38-cp38-macosx_10_9_x86_64.whl (10.1 MB)
     |████████████████████████████████| 10.1 MB 2.1 MB/s 
Requirement already satisfied, skipping upgrade: python-dateutil>=2.7.3 in /opt/anaconda3/lib/python3.8/site-packages (from pandas) (2.8.1)
Requirement already satisfied, skipping upgrade: pytz>=2017.2 in /opt/anaconda3/lib/python3.8/site-packages (from pandas) (2020.1)
Requirement already satisfied, skipping upgrade: numpy>=1.15.4 in /opt/anaconda3/lib/python3.8/site-packages (from pandas) (1.18.5)
Requirement already satisfied, skipping upgrade: six>=1.5 in /opt/anaconda3/lib/python3.8/site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Installing collected packages: pandas
  Attempting uninstall: pandas
    Found existing installation: pandas 1.0.5
    Uninstalling pandas-1.0.5:
      Successfully uninstalled pandas-1.0.5
Successfully installed pandas-1.1.3

I guess this is ok, not sure if my anaconda environment will now have lost its integrity in some way. I guess my question still stands, regarding the way to upgrade via anaconda/conda, or perhaps there is no difference and it is fine to mix anaconda/conda and pip commands. I really don't know.

FlyingTeller

Anaconda comes with a whole bunch of packages pre-installed. As such, they of course have interdependencies that sometimes also restrict that not the newest version of some package can be used. So in your case, you can see that when trying

conda update pandas

it gave you

Updating pandas is constricted by 

anaconda -> requires pandas==1.0.5=py38h959d312_0

Basically telling you that the pre-installed anaconda package bundle requires that pandas is at version 1.0.5 to function properly

When you do

conda install -c conda-forge pandas=1.1.0

then conda tries to disentangle all the requirements that led to 1.0.5 being installed previously and tries to find a way to get the version you required working. Since the list of packages that are pre-installed in your base enviroment is long (check conda list), this takes a long time (what you described as hanging) and will probably fail eventually.

I was able to upgrade to pandas 1.1.3 via pip:

This is because essentially, pip will "not care" about all the interdependencies of libraries that where pre-installed with anaconda

not sure if my anaconda environment will now have lost its integrity

As a summary:

  1. conda is convinced that at the current state 1.0.5 is the version needed for all packages to work properly
  2. with pip install you forcefully installed a different version

所以是的,原则上您现在处于状态不一致的状态pip install,这是由于使用升级先前由conda管理的程序包而引起的,这是您永远都不应做的,请参阅anaconda网站以获取详细信息。

为了避免基本环境中预装的软件包带来麻烦,您可以创建一个新环境,然后在其中自由安装所需的版本:

  1. conda create -n <env-Name> pandas=1.1
  2. conda activate <env-Name>

这将创建一个仅pandas安装虚拟环境然后,您可以conda install根据需要添加其他软件包

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何创建列表列表,其中每个子列表“递增”,如下所示:[1、0、0],[1、1、0],[1、1、1]

如何在Python中以+1(带有加号)而不是1的方式打印+1?

如何在JavaScript中[1,2] + [4,5,6] [1] = 1,25

如何在mongo中查询1 = 1或1 = 0?

在Python中,如何对嵌套列表求和:[[1,0],[1,1],[1,0]]→[3,1]

如何使用a [0]-a [0] a [1]-a [0] a [1] a [2]输出数组

如何解决该递归T(n)= T(n − 1)+ lg(1 + 1 / n),T(1)= 1?

正则表达式:如何在(1,2)(1,1)(1,1)中捕获数字

如何修复'ValueError:形状(1,3)和(1,1)未对齐:3(dim 1)!= 1(dim 0)'错误

如何解决1不=== 1反应

如何在JAVA中为(2 ^(n-1)mod 1 = 1)保留更大的值

我如何在Anaconda中拥有两个不同的环境?(Python 3.7、1个32位和1个64位)

如何在-1和1之间在熊猫中缩放数据

如何比较两个数组并在Clickhouse中找到数组中的匹配项(0/1)

如何在Debian上安装libXcursor.so.1?

如何检索数据值0-1并在Radiobuttonlist中显示为名称

如何为{'1','1'}和{'1','1','\ 0'}给相同的输出感到惊讶?

如何在Erlang中打印嵌套列表:[[1],[1、1],[1、1、1]]?

如何在软RAID 1上正确安装GRUB?

如何在RHEL7上安装webkitgtk1

如何在CentOS 7中安装udisks1?

[“ $ {1:0:1}” ='-']的含义

如何在Extbase中更新1:1关系

MacOS 中提示/PS1 中的 Anaconda 环境?

为什么为 dx[dir 选择值 {1, 1, 0, -1, -1, -1, 0, 1} 和 {0, 1, 1, 1, 0, -1, -1, -1} ] 和 dy[dir]?

如何在 Python 中将 datetime.datetime(2012, 1, 1, 0, 0) 更改为 1/1/2012?

用于生成 [((0,0),0), ((0,1),0), ((1,0),0), ((1,1),0)] 的代码实际上给出了 [0 , 0, 0, 1, 1, 0, 1, 1],如何解决?

在 M1 Mac 上安装 Node

如何在 Mac M1 中安装 PyAudio