나는 deblurrer라는 사용자 정의 패키지를 가지고 있으며 신경망을 훈련시키는 스크립트입니다.
Google Colab에서 repo를 성공적으로 복제했으며 setup.py 모듈을 실행하고 deblurrer 1.0.0을 설치하는 데 필요한 모든 것을 갖추고 있습니다. 내 PC에 디 블러 러를 로컬로 설치하면 모든 것이 예상대로 작동하지만 !python setup.py install
Colab에서 실행하려고하면 아무것도 설치되지 않고 실제로 출력에 모든 것이 정상이라고 표시되지만 패키지를 가져올 수 없습니다. 문제를 재현하기 위해 두 개의 별도 Colab 셀에서 다음 코드를 실행합니다.
# Cell 01
# Executes the cell in bash mode
%%bash
git clone https://github.com/ElPapi42/deep-deblurring
python deep-deblurring/setup.py install
# Cell 02
import deblurrer
보시다시피 설치는 예상대로 실행되지만 가져올 때 :ModuleNotFoundError: No module named 'deblurrer'
무엇이 잘못 될 수 있습니까?
Colab과는 약간 다른 접근 방식을 취해야합니다.
# 1. Download the repo and set it as the current directory
!git clone https://github.com/ElPapi42/deep-deblurring
%cd deep-deblurring
# 2. install the project/module
!python setup.py install
# 3. Add the project directory to the path
import os, sys
sys.path.append(os.getcwd())
#4. Run your code
# ....
여기에 설명 된대로 https://stackoverflow.com/a/53747334/2466781
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다