第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

pycharm 不導(dǎo)入隨機(jī)回溯(最后一次調(diào)用):

pycharm 不導(dǎo)入隨機(jī)回溯(最后一次調(diào)用):

犯罪嫌疑人X 2022-10-18 17:15:20
python新手,嘗試猜謎游戲。我正在使用pycharm。繼承人的代碼后跟錯(cuò)誤這是我的代碼代碼:import randomlucky number= random.randrange(1,100)guess = int(input('guess the number in the range 1-100: '))while guess != lucky number:    if guess < lucky number:        print ("too low, try higher")        guess = int(input("\n Guess a number between 1-100")                    else:        print ("too high, try lower")        guess = int(input("\n Guess a number between 1-100"))print ("you guessed the number correctly, Congratulations!")import randomlucky number= random.randrange(1,100)guess = int(input('guess the number in the range 1-100: '))while guess != lucky number:    if guess < lucky number:        print ("too low, try higher")        guess = int(input("\n Guess a number between 1-100")                    else:        print ("too high, try lower")        guess = int(input("\n Guess a number between 1-100"))print ("you guessed the number correctly, Congratulations!")這是錯(cuò)誤:    Error:Traceback (most recent call last):  File "<input>", line 1, in <module>  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script  File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile    stream = tokenize.open(file)  # @UndefinedVariable  File "C:\Users\Shane McDonagh\AppData\Local\Programs\Python\Python38-32\lib\tokenize.py", line 392, in open    buffer = _builtin_open(filename, 'rb')FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Shane McDonagh/.PyCharmCE2019.3/config/scratches/scratch_1.py'
查看完整描述

3 回答

?
12345678_0001

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊

它說random圖書館不存在。這要么是由于您沒有通過安裝它,pip要么是 pycharm 沒有正確設(shè)置正確的配置。由于random是默認(rèn)庫(kù),與大多數(shù)其他庫(kù)不同,您不需要通過pip命令安裝它。所以你必須修復(fù)你的配置。O 在屏幕的右上角File > Settings > Project: project-name > Project Interpreter編輯您的配置,或者完全刪除您的配置并創(chuàng)建一個(gè)新配置,或者選擇一個(gè)不同的現(xiàn)有配置。

也不要import在文件上多次使用相同的語句,這可能會(huì)導(dǎo)致大量錯(cuò)誤和問題,我假設(shè)您不小心粘貼了兩次代碼,但我想指出以防萬一。


查看完整回答
反對(duì) 回復(fù) 2022-10-18
?
慕斯709654

TA貢獻(xiàn)1840條經(jīng)驗(yàn) 獲得超5個(gè)贊

FileNotFoundError:[Errno 2] 沒有這樣的文件或目錄:'C:/Users/Shane McDonagh/.PyCharmCE2019.3/config/scratches/scratch_1.py'

此錯(cuò)誤表示您嘗試運(yùn)行的文件不存在。它什么也沒說random。要修復(fù)錯(cuò)誤,只需右鍵單擊編輯器選項(xiàng)卡并選擇運(yùn)行。這應(yīng)該為該特定文件創(chuàng)建一個(gè)新的運(yùn)行配置。如果這不能解決問題,請(qǐng)刪除所有運(yùn)行配置并重試。


查看完整回答
反對(duì) 回復(fù) 2022-10-18
?
青春有我

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超8個(gè)贊

我有同樣的問題。就我而言,我在 procject 文件夾中創(chuàng)建了一個(gè)名為 random.py 的文件。我改名了,問題解決了



查看完整回答
反對(duì) 回復(fù) 2022-10-18
  • 3 回答
  • 0 關(guān)注
  • 214 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)