代码之家  ›  专栏  ›  技术社区  ›  Ray Tayek

如何在水蟒中创造张力流的环境?

  •  0
  • Ray Tayek  · 技术社区  · 5 年前

    人们通常是怎么做这种事的?

    编辑:被一个障碍物挡住了。在移除环境时遇到问题。找到了通往 fix 这个。得到了:

        PackagesNotFoundError: The following packages are missing from the target environment:
    
      -
    

    现在尝试@b20001011建议:conda create-n myenv python=3.7。。。得到了3.8.1

    ...>pip install tensorflow
    ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
    ERROR: No matching distribution found for tensorflow
    

    编辑结束。

    编辑2:

    这在今天起作用了:

    (base) D:\ray\dev\ml\DC to Edge Course>conda update conda
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    # All requested packages already installed.
    

    编辑2结束。

    我有:

    (base) ...>conda env list
    
      conda environments:
    
    base                     D:\Anaconda3
                          *  d:\Anaconda3
    

    为什么我要两个?

    The following packages will be DOWNGRADED:
    
      anaconda                                   2019.10-py37_0 --> custom-py37_1
      pycosat                              0.6.3-py37hfa6e2cd_0 --> 0.6.3-py37he774522_0
    

    我做a时也会发生同样的事情:conda update anaconda

    当我尝试更新python时,我得到:

    Updating python is constricted by
    
    anaconda -> requires python==3.7.4=h5263a28_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.
    

    我要继续吗?

    当我创建一个新环境时,它没有python。

    The following packages cannot be cloned out of the root environment:
     - defaults/win-64::conda-4.8.1-py37_0
     - defaults/win-64::conda-build-3.18.9-py37_3
     - defaults/win-64::conda-env-2.6.0-1
    

    这是怎么回事?它会对张力低吗?

    0 回复  |  直到 4 年前
        1
  •  1
  •   B200011011    5 年前

    在python环境中没有遇到类似的问题。此链接包含创建和管理conda环境所需的信息, https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

    conda create -n myenv python=3.7 将创建一个名为 myenv conda remove --name myenv --all .

    conda env list conda activate myenv pip install --upgrade tensorflow

    这里还提供了使用conda环境设置tensorflow的说明, https://www.tensorflow.org/install/pip

    https://www.tensorflow.org/install/gpu

    在pycharm中,从现有conda环境中选择python解释器将使其所有包可用。

        2
  •  1
  •   turong    5 年前

    enter image description here

    我们更喜欢使用 conda install <package> 而不是 pip install <package>