在终端里打pip和import导入都不好使是为什么

来源:3-1 强大的第三方包

老虎不吃喵

2021-01-15 14:17:26

这个是查找包

(venv) C:\Users>python

Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> pip -V

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

NameError: name 'pip' is not defined

>>>


这个是inport导入模块

>>> import animal

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

ModuleNotFoundError: No module named 'animal'


写回答

1回答

好帮手慕燕燕

2021-01-15

同学,你好!为同学的疑惑做如下解答:

1、pip -V不能使用是由于同学先进入了Python解释器,ctrl+Z,然后按回车键退出,再输入pip -V即可;

2、import animal,提示找不到这个模块,同学先检查项目中是否有animal模块,如果模块存在,检查一下导入路径是否正确

祝学习愉快~

0

0 学习 · 2433 问题

查看课程