首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >conda虚拟环境不工作

conda虚拟环境不工作
EN

Stack Overflow用户
提问于 2018-07-21 11:26:04
回答 5查看 10.2K关注 0票数 18

我有一个脚本gapminder1.py,它使用熊猫和sklern。

代码语言:javascript
复制
# TODO: Add import statements

import pandas as pd

from sklearn.linear_model import LinearRegression


# Assign the dataframe to this variable.
# TODO: Load the data
bmi_life_data = pd.read_csv("CSV_DATA/bmi_and_life_expectancy.csv")
print(bmi_life_data)
# Make and fit the linear regression model
#TODO: Fit the model and Assign it to bmi_life_model
bmi_life_model = LinearRegression()
bmi_life_model.fit(bmi_life_data[['BMI']], bmi_life_data[['Life expectancy']])
# Make a prediction using the model
# TODO: Predict life expectancy for a BMI value of 21.07931
laos_life_exp = bmi_life_model.predict(21.07931)

我从cmd控制台运行这个脚本,它运行得很好,但是pycharm中的相同脚本显示了错误。

代码语言:javascript
复制
C:\Users\tripathi\AppData\Local\Continuum\anaconda3\envs\dsnd\python.exe C:/Users/tripathi/PycharmProjects/dsnd/gapminder1.py
Traceback (most recent call last):
  File "C:/Users/tripathi/PycharmProjects/dsnd/gapminder1.py", line 3, in <module>
    import pandas as pd
  File "C:\Users\tripathi\AppData\Local\Continuum\anaconda3\envs\dsnd\lib\site-packages\pandas\__init__.py", line 19, in <module>
    "Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']

我在这两个地方都使用相同的conda环境,但不知道为什么它不能正常工作。

EN

Stack Overflow用户

发布于 2018-07-21 11:32:10

确保已安装了pip,也请检查我的计算机或控制面板中环境变量处的路径。

票数 1
EN
查看全部 5 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51455571

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档