2018-summer-DL-training-program / Lab-2-Image-Captioning

Image Captioning
1 stars 1 forks source link

Coco library install issue #2

Open molecule-lee opened 6 years ago

molecule-lee commented 6 years ago

It seems need python3 to run setup.py but not python2 otherwise you will see error "not found _mask.c".

In install stage(python3 setup.py install), the default installed PATH refers to the read-only folder.(no write permission for us). So. it needs to use --prefix to give a local install PATH instead of the default installed PATH.

hui-po-wang commented 6 years ago

Hi @molecule-lee ,

Please try step 0,

pip install cython

If you don't have the permission, I guess you may need to ask your IT for help.

TA

pablosun commented 6 years ago

@molecule-lee 請問你用 python3 setup 下的指令是什麼呢?我用 Python3 還是會得到 _mask.c 找不到的錯誤:

image

hui-po-wang commented 6 years ago

@pablosun,

這個error,應該pip install cython可以解決

favrei commented 6 years ago

screenshot_219

無法使用 pip install cython,昨天課堂中說的「IT 已把整包 repo 拷一份至 Local 」似乎沒有起效。

pablosun commented 6 years ago

Hi @killer9619 ,

我試起來,在內部 GPU server 安裝 cython 有幾點要注意的:

  1. 要先確認 pip 的 mirror server有設定好,~/.pip/pip.conf 的內容必須是:

    [global]
    index-url = http://10.9.16.152/simple
    [install]
    trusted-host = 10.9.16.152
  2. 如果你是使用 Python 3.5 + PyTorch,要換成 pip3 而不是 pip,然後要指定把 cython 安裝到你有權限寫入的目錄下面,不然 pip 會抱怨它沒有權限能寫入 site-packages 目錄

    pip3 install cython -t ~/cython_lib
  3. 要把 cython 的安裝路徑添加到 Python 的 library 搜尋路徑,PYTHONPATH 這個環境變數裡面。我的做法是修改 ~/.cshrc.user ,添加下面這一行:

    setenv PYTHONPATH ~/cython_lib

    改完要重新開一個 terminal,或是用 source ~/.cshrc.user 重新執行這個 cshrc

不過聽說班長已經在幫大家弄流程了,之後應該會公布一個大家都可以用的安裝流程。

favrei commented 6 years ago

Hello @pablosun ,

It worked. Very appreciated!

lfirefly commented 6 years ago

Hi @pablosun,

是的,我是班長。哈 稍早 Vanessa 寄出來的流程應該就是可以用的了

pip install path 那邊,可以不指定路徑,而是加上 --user 來安裝 整行指令可以改用 pip3 install cython --user 應該也不用改 Pythonpath 就可以 work

希望有幫助囉,謝謝