ImportError:没有名为folium的模块?

问题描述

我尝试使用:

StringBuilder mStr = new StringBuilder();
for(int i=0; i<str.length(); i++) {
    int cp = Character.codePointAt(str,i);
    int charCount = Character.charCount(cp);
    if (charCount > 1) {
        i += charCount - 1; // 2.
        if (i >= str.length()) {
            throw new IllegalArgumentException("truncated unexpectedly");
        }
    }

    if (cp < 128) {
        mStr .appendCodePoint(cp);
    } else {
        mStr .append(String.format("\\u%x",cp));
    }
}
return mStr.toString();

并且:

pip install folium

我也尝试安装特定版本,但仍然无法正常工作。当我再次尝试安装命令时,我会得到以下提示

conda install -c conda-forge folium

我也尝试过:

    Defaulting to user installation because normal site-packages is not writeable
    Requirement already satisfied: folium==0.11.0 in /home/rem/.local/lib/python3.8/site-packages 
    (0.11.0)
    Requirement already satisfied: jinja2>=2.9 in /usr/lib/python3/dist-packages (from 
    folium==0.11.0) (2.10.1)
    Requirement already satisfied: branca>=0.3.0 in /home/rem/.local/lib/python3.8/site-packages 
    (from folium==0.11.0) (0.4.1)
    Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from folium==0.11.0) 
    (2.22.0)
    Requirement already satisfied: numpy in /home/rem/.local/lib/python3.8/site-packages (from
    folium==0.11.0) (1.18.5)

或:

conda install branca

我仍然收到此错误

pip install branca

请帮助!!!

解决方法

始终可以使用pip网站手动下载和临时安装任何wheelodex软件包,如下所示:

  1. 转到https://www.wheelodex.org/projects/folium/
  2. 按照上一页的download link,您将获得folium-0.11.0-py2.py3-none-any.whl文件。
  3. 使用pip来安装文件,例如python -m pip install folium-0.11.0-py2.py3-none-any.whl

您也可以类似的方式安装其他不起作用的软件包。