Невозможно импортировать IMDB - PullRequest
0 голосов
/ 14 февраля 2020

Добрый вечер. Я сделал virutalenv в Linux Mint 19. Я установил IMDbPY == 6.8. У меня есть файл mov ie .py в папке MyProject. Когда я запускаю python mov ie .py, я получаю «Невозможно импортировать IMDB».

Я нашел здесь ветку 2016 года, в которой говорится, что я не назвал файл imdb.py, который Я назвал это так, но изменил его на mov ie .py. Я закрыл все и затем начал обратно. Все равно получите те же ошибки.

Я использую Python 3.6.

Вот файл, который я пытаюсь запустить:

from imdb import IMDB

# create an instance of the IMDb class
ia = IMDB()

# get a movie and print its director(s)
the_matrix = ia.get_movie('0133093')
for director in the_matrix['directors']:
    print(director['name'])

# show all information that are currently available for a movie
print(sorted(the_matrix.keys()))

# show all information sets that can be fetched for a movie
print(ia.get_movie_infoset())

# update a Movie object with more information
ia.update(the_matrix, ['technical'])
# show which keys were added by the information set
print(the_matrix.infoset2keys['technical'])
# print one of the new keys
print(the_matrix.get('tech'))

Вот трассировка:

(myenv) chess@chess:~/MyProjects$ python movie.py
Traceback (most recent call last):
  File "movie.py", line 1, in <module>
    from imdb import IMDB
ImportError: cannot import name 'IMDB'

Ошибка показывает, что он находится в строке 1 из imdb import IMDB Traceback показывает Невозможно импортировать IMDB

Спасибо за любую помощь.

...