?場景復(fù)現(xiàn):在cmd中使用pip命令安裝python庫時,如果先輸入python進入了python的編譯環(huán)境后,是無法使用pip命令的,會出現(xiàn)如下報錯:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pip' is not defined. Did you mean: 'zip'?
原因分析:pip 是 Python 的包管理器。是一個工具,允許你安裝和管理不屬于標準庫的其他庫和依賴。pip需要在cmd根目錄運行,進入python環(huán)境后無法(?)運行。文章來源:http://www.zghlxwxcb.cn/news/detail-457904.html
解決辦法:如果已經(jīng)進入python環(huán)境(輸入行左邊顯示 >>>),"Ctrl+Z"(輸入行顯示^Z)回車退出python環(huán)境(輸入行左邊顯示 C:\Users\"Users Name">),即可正常運行pip命令進行例如python庫的安裝pip install。文章來源地址http://www.zghlxwxcb.cn/news/detail-457904.html
到了這里,關(guān)于【新手向】【Python】pip install 報錯File “<stdin>“, line 1, in <module>NameErro的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!