2017-10-19 19 views
-2

작은 질문이 있습니다. Discord 봇은 Python으로 작성되었으며 오류가 계속 발생합니다. 이것은 내 봇의 코드입니다 :PIP 설치 중에 Python3.x에서 '모듈'Discord 'not found'가 발견되었습니다.

import discord 
import asyncio 

client = discord.Client() 

@client.event 
async def on_ready(): 
    print('Logged in as') 
    print(client.user.name) 
    print(client.user.id) 
    print('------') 

@client.event 
async def on_message(message): 
    if message.content.startswith('!test'): 
     await client.send_message(message.channel, 'Calculating messages...') 

client.run('You arent gonna get my token =D') 

내가 실행할 때이 오류가 온다 : CMD에서

Traceback (most recent call last): 
    File "C:\Users\DELL\Documents\Testing\discordbt.py", line 1, in <module> 
import discord 
ModuleNotFoundError: No module named 'discord' 
정말 어떻게 해야할지하지 않습니다

, 내가 한 모든이 다음 명령 :,632 : 전부, 나는 오류없이 설치된 모듈을 확인했다, 그들은 모두가 등, 그리고 난 당신이 다른 "프로그램"을 필요로 알고 난 다음 프로그램을 설치 한 한

pip install discord.py 
pip install asyncio 

10 및 Python 3.7.0a2 64x

내 PC는 64x 비트 아키텍처이므로 완전히 일치합니다.

+0

[Discord PIP 설치 오류] (https://stackoverflow.com/questions/46133128/discord-pip-install-error)의 가능한 복제본 – thatrockbottomprogrammer

+2

스크립트에 올바른 통역사를 사용하고 있습니까? 여러 Python dist가 설치되어있는 경우 "ModuleNotFound"를 보는 것이 일반적입니다. – lotrus28

+0

인터 피터? Dist? 설명해주세요 :) @ lotrus28 – DeadlyFirex

답변

1

py를 사용하여 스크립트를 실행하는 python 버전의 외부 디렉토리에 모듈을 설치할 가능성이 있습니다. 터미널 명령에 버전 번호를 추가하여 파이썬 버전을 지정해보십시오 (예 : python3.6 -m pip install discord.py). 그래도 작동하지 않으면 pip 대신 pip3을 사용해보세요.

편집 : asyncio도 설치하려고하지 마십시오. 표준 라이브러리에 포함되어 있습니다.