python mpl_toolkits安装问题

时间:2016-06-06 15:21:53

标签: python python-3.x pip

在命令pip install mpl_toolkits之后,我收到下一个错误:

  

找不到满足要求mpl_toolkits的版本(来自版本:)

     

找不到mpl_toolkits

的匹配分布

我试图谷歌,但没有任何帮助。我该如何解决这个问题?

4 个答案:

答案 0 :(得分:50)

它不在PyPI上,您不应该通过pip 进行安装。如果您安装了matplotlib,则应该可以直接导入mpl_toolkits

$ pip install --upgrade matplotlib
...

$ python
>>> import mpl_toolkits
>>> 

答案 1 :(得分:10)

它不能在 Ubuntu 16.04 上工作,似乎有些库已经被遗忘在python安装包中。你应该使用包管理器。

解决方案

pip 卸载 matplotlib ,然后使用 apt-get 再次安装

python 2:

sudo pip uninstall matplotlib
sudo apt-get install python-matplotlib

python 3:

sudo pip3 uninstall matplotlib
sudo apt-get install python3-matplotlib

答案 2 :(得分:3)

如果任何人在Mac上遇到问题,都可以尝试

/*
 * This file was generated by the Gradle 'init' task.
 *
 * This generated file contains a sample Java project to get you started.
 * For more details take a look at the Java Quickstart chapter in the Gradle
 * user guide available at https://docs.gradle.org/5.0/userguide/tutorial_java_projects.html
 */

plugins {
    // Apply the java plugin to add support for Java
    java

    // Apply the application plugin to add support for building an application
    application
}

repositories {
    // Use jcenter for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
    mavenCentral()
}

dependencies {
    // This dependency is found on compile classpath of this component and consumers.
    implementation("com.google.guava:guava:26.0-jre")

// https://mvnrepository.com/artifact/org.basex/basex
compile (group= "org.basex", name = "basex" , version = "7.3.1")

compile (group = "javax.xml.xquery" , name = "xqj-api" , version = "1.0")



    // Use TestNG framework, also requires calling test.useTestNG() below
    testImplementation("org.testng:testng:6.14.3")
}

application {
    // Define the main class for the application
    mainClassName = "org.basex.examples.local.App"
}

val test by tasks.getting(Test::class) {
    // Use TestNG for unit tests
    useTestNG()
}

答案 3 :(得分:1)

由于缺乏声誉,我无法发表评论,但是,如果您使用的是arch linux,则应该可以直接在arch存储库中找到相应的库。例如mpl_toolkits.basemap

pacman -S python-basemap