1. 下载安装PyCharm(pycharm-community-2021.1.1.exe)
2. 创建一个默认项目,并修改main.py
https://github.com/hivsuper/pythonStudy.git
import numpy as np
import pandas as pd
def print_hi():
# Use a breakpoint in the code line below to debug your script.
print(pd.Series([1, 3, 5, np.nan, 6, 8])) # Press Ctrl+F8 to toggle the breakpoint.
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi()
3. 在终端运行pip install pipenv
添加Pipenv支持
4. 通过添加环境变量WORKON_HOME来修改Pipenv的默认路径(需重启操作系统使变量生效)
5. 在PyCharm中添加Python Interpreter
File --> Settings… -> Project: pythonStudy -> Python Interpreter -> Add…
6. 无法编译成功
7. 在PyCharm重新安装numpy和 pandas后成功编译
https://blog.csdn.net/defonds/article/details/108055633
File --> Settings… -> Project: pythonStudy -> Python Interpreter
8. 运行结果
D:\Pipenv\pythonStudy-xxxxxx\Scripts\python.exe D:/PycharmProjects/pythonProject/main.py
0 1.0
1 3.0
2 5.0
3 NaN
4 6.0
5 8.0
dtype: float64