Replace python setup.py install with pip install -e . (#1460)

This commit is contained in:
Robert Nishihara
2018-02-22 11:15:03 -08:00
committed by Philipp Moritz
parent f4b1881fec
commit 5859a2d249
8 changed files with 25 additions and 27 deletions
+4 -4
View File
@@ -24,7 +24,7 @@ if [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
pip install -q numpy cython cmake funcsigs click colorama psutil redis tensorflow gym==0.9.5 flatbuffers opencv-python pyyaml pandas requests
pip install -q cython cmake tensorflow gym opencv-python pyyaml pandas requests
elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then
sudo apt-get update
sudo apt-get install -y cmake pkg-config python-dev python-numpy build-essential autoconf curl libtool unzip
@@ -32,7 +32,7 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
pip install -q numpy cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python pyyaml pandas requests
pip install -q cython cmake tensorflow gym opencv-python pyyaml pandas requests
elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then
# check that brew is installed
which -s brew
@@ -48,7 +48,7 @@ elif [[ "$PYTHON" == "2.7" ]] && [[ "$platform" == "macosx" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
pip install -q numpy cython cmake funcsigs click colorama psutil redis tensorflow gym==0.9.5 flatbuffers opencv-python pyyaml pandas requests
pip install -q cython cmake tensorflow gym opencv-python pyyaml pandas requests
elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then
# check that brew is installed
which -s brew
@@ -64,7 +64,7 @@ elif [[ "$PYTHON" == "3.5" ]] && [[ "$platform" == "macosx" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh -nv
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
pip install -q numpy cython cmake funcsigs click colorama psutil redis tensorflow gym flatbuffers opencv-python pyyaml pandas requests
pip install -q cython cmake tensorflow gym opencv-python pyyaml pandas requests
elif [[ "$LINT" == "1" ]]; then
sudo apt-get update
sudo apt-get install -y cmake build-essential autoconf curl libtool unzip
+11 -13
View File
@@ -9,25 +9,23 @@ helpful.
.. code-block:: shell
cd ray/python
python setup.py develop
pip install -e . --verbose
(as opposed to ``python setup.py install``). When you do the "install"
version, files will be copied from the Ray directory to a directory of Python
packages (often something like
The ``-e`` means "editable", so changes you make to files in the Ray
directory will take effect without reinstalling the package. In contrast, if
you do ``python setup.py install``, files will be copied from the Ray
directory to a directory of Python packages (often something like
``/home/ubuntu/anaconda3/lib/python3.6/site-packages/ray``). This means that
changes you make to files in the Ray directory will not have any effect.
However, when you run the "develop" version, no files will be copied and so
any changes you make to Python files will immediately take effect without
rerunning ``setup.py``.
If you run into **Permission Denied** errors when running ``setup.py``, you
can try doing ``python setup.py develop --user``. You may also need to run
something like ``sudo chown -R $USER /home/ubuntu/anaconda3`` (substituting
in the appropriate path).
If you run into **Permission Denied** errors when running ``pip install``,
you can try adding ``--user``. You may also need to run something like ``sudo
chown -R $USER /home/ubuntu/anaconda3`` (substituting in the appropriate
path).
If you make changes to the C++ files, you will need to recompile them.
However, you do not need to rerun ``setup.py``. Instead, you can recompile
much more quickly by doing
However, you do not need to rerun ``pip install -e .``. Instead, you can
recompile much more quickly by doing
.. code-block:: shell
+3 -2
View File
@@ -4,12 +4,13 @@ Cython
Getting Started
---------------
This document provides examples of using Cython-generated code in ``ray``. To get started, run the following from directory ``$RAY_HOME/examples/cython``:
This document provides examples of using Cython-generated code in ``ray``. To
get started, run the following from directory ``$RAY_HOME/examples/cython``:
.. code-block:: bash
pip install scipy # For BLAS example
python setup.py develop
pip install -e .
python cython_main.py --help
You can import the ``cython_examples`` module from a Python script or interpreter.
+2 -2
View File
@@ -28,7 +28,7 @@ To build Ray, first install the following dependencies. We recommend using
brew update
brew install cmake pkg-config automake autoconf libtool boost openssl bison wget
pip install numpy funcsigs click colorama psutil redis flatbuffers cython --ignore-installed six
pip install cython
If you are using Anaconda, you may also need to run the following.
@@ -46,7 +46,7 @@ Ray can be built from the repository as follows.
git clone https://github.com/ray-project/ray.git
cd ray/python
python setup.py install # Add --user if you see a permission denied error.
pip install -e . --verbose # Add --user if you see a permission denied error.
Alternatively, Ray can be built from the repository without cloning using pip.
+2 -2
View File
@@ -35,7 +35,7 @@ To build Ray, first install the following dependencies. We recommend using
# If you are on Ubuntu 14.04, you need the following.
pip install cmake
pip install numpy funcsigs click colorama psutil redis flatbuffers cython
pip install cython
If you are using Anaconda, you may also need to run the following.
@@ -54,7 +54,7 @@ Ray can be built from the repository as follows.
git clone https://github.com/ray-project/ray.git
cd ray/python
python setup.py install # Add --user if you see a permission denied error.
pip install -e . --verbose # Add --user if you see a permission denied error.
Alternatively, Ray can be built from the repository without cloning using pip.
+1 -2
View File
@@ -235,11 +235,10 @@ necessary to upgrade Ray. It should look something like the following:
pushd .
# Upgrade Ray.
cd ray
git remote set-url origin https://github.com/ray-project/ray
git checkout master
git pull
cd python
python setup.py install --user
pip install -e . --verbose
popd
This script executes a series of git commands to update the Ray source code, then builds
+1 -1
View File
@@ -5,5 +5,5 @@ FROM ray-project/base-deps
ADD ray.tar /ray
ADD git-rev /ray/git-rev
WORKDIR /ray/python
RUN python setup.py install
RUN pip install -e .
WORKDIR /ray
@@ -90,7 +90,7 @@ setup_commands:
# Build Ray.
- git clone https://github.com/ray-project/ray || true
- pip install boto3==1.4.8
- cd ray/python; python setup.py develop
- cd ray/python; pip install -e . --verbose
# Custom commands that will be run on the head node after common setup.
head_setup_commands: []