patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

pip install eos-py==1.1.2 fails with Python2 #274

Closed francoisruty closed 4 years ago

francoisruty commented 4 years ago
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-MgGlBR/eos-py/setup.py", line 64, in <module>
    with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
TypeError: 'encoding' is an invalid keyword argument for this function

I got the same problem if I try to install each of the past published versions

francoisruty commented 4 years ago

after some googling it seems using io.open would work both in python 2 and python 3 (I'm using python 2.7)

francoisruty commented 4 years ago

ok so I just moved all my project to python 3 and now it works I suggest to update the documentation to mention pip3 install instead of pip install, as eos-py is currently not installable with pip It might be though if we just remove the long_description field that uses this file open command (or use io.open as stated earlier)

francoisruty commented 4 years ago

Someone asked me for my environment (how I installed eos-py with pip3), here it is, it's a dockerfile:

FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04

RUN apt-get update --fix-missing RUN apt-get install -y python3 python3-dev python3-pip wget vim libglib2.0-0 libsm6 libxext6 libxrender-dev build-essential cmake pkg-config libx11-dev libatlas-base-dev libgtk-3-dev make cython3 python3-setuptools

Install gcc 7 for eos installation

RUN apt-get install -y software-properties-common python3-software-properties && add-apt-repository ppa:ubuntu-toolchain-r/test && apt update && apt install -y g++-7

Install cmake 3.8 for eos installation

RUN apt-get purge -y cmake && wget https://github.com/Kitware/CMake/releases/download/v3.15.1/cmake-3.15.1.tar.gz && tar -xzvf cmake-3.15.1.tar.gz && cd cmake-3.15.1 && ./bootstrap && make -j4 && make install

RUN pip3 install numpy==1.15.0 RUN pip3 install opencv-python==3.4.0.12 RUN pip3 install dlib RUN pip3 install scipy==0.16 RUN CC=which gcc-7 CXX=which g++-7 pip3 install eos-py

imaccormick275 commented 4 years ago

deleted comment as solved my issue. didn't have xcode installed: xcode-select --install

patrikhuber commented 4 years ago

Hi,

Sorry for the slightly late reply.

I'm going to close this - Python 2 is at the end of its lifetime.

Also I'd say whether the correct command to use is pip or pip3 is the user's responsibility - they should know their distribution and how to use the correct Python/pip version. On many distributions, Python 3 is the default and the command to use Python 3's pip is simply pip. The same also applies to Python 3 virtualenvs where the command will be simply pip.