xinntao / ESRGAN

ECCV18 Workshops - Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution. The training codes are in BasicSR.
https://github.com/xinntao/BasicSR
Apache License 2.0
5.91k stars 1.05k forks source link

ImportError: No module named cv2 #43

Closed cyberfunk closed 5 years ago

cyberfunk commented 5 years ago

Hello, I followed the various steps and installed all of the dependancies. When I run the test code I get: ImportError: No module named cv2

cv2 is located at: /usr/local/lib/python3.7/site-packages/cv2

I have a file called .bash_profile located at /Users/MyUserName/.bash_profile which I added this line to: export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Also I get an error after installing PsyTorch and running the first line of their test code to verify correct install: from future import print_function

That test fails with error: from: can't read /var/mail/future

I have no idea what's going on with this as it's my first time trying to run ESRGAN

I used Homebrew to install Python 3 then used the pip3 command to install the required dependencies. I did not use Anaconda as I've never used that before but have used Homebrew many times in the past on other projects.

Any help is much appreciated:-)

cyberfunk commented 5 years ago

UPDATE: I solved my own issue. I needed to clear my bash_profile and add the following text:

alias python='python3' PYTHONPATH="${PYTHONPATH}:/usr/local/lib/python3.7/site-packages/" export PYTHONPATH