Skip to content
This repository has been archived by the owner on Oct 18, 2019. It is now read-only.

ImportError: cannot import name main #83

Open
akhanivishant opened this issue Feb 26, 2019 · 3 comments
Open

ImportError: cannot import name main #83

akhanivishant opened this issue Feb 26, 2019 · 3 comments

Comments

@akhanivishant
Copy link

Hi ,
while running : docker build -t caffe:cpu https://raw.githubusercontent.com/BVLC/caffe/master/docker/cpu/Dockerfile This command , i am getting error at your step 7 , when you are updating pip version.

File "/usr/bin/pip", line 9, in
from pip import main
ImportError: cannot import name main

As i have already installed latest pip version but when you update in it's giving error because of pip.

@mmrblack
Copy link

I have same problem.

@mmrblack
Copy link

@akhanivishant I find a way to solve this problem.

  1. run this command 'docker run -ti bvlc/caffe:cpu caffe --version' instead
    2.then run 'docker run --volume=$(pwd):/workspace bvlc/caffe:cpu python ./classify_nsfw.py --model_def nsfw_model/deploy.prototxt --pretrained_model nsfw_model/resnet_50_1by2_nsfw.caffemodel test_image.jpg'
    It works!

@sxl613
Copy link

sxl613 commented Mar 6, 2019

@akhanivishant I got it to work by changing
do pip install $req;

to

do python -m pip install $req;

in the Dockerfile.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants