Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Use the following code:

    Code Block
    languagebash
    # Initialize virtual environment called "env" in ~/.virtualenvs or any other directory. (Consider using pyenv, to manage the python version as well as installed packages in your virtual environment)
    $ python3 -m venv ~/.virtualenvs/env
    
    # Activate virtual environment.
    $ . ~/.virtualenvs/env/bin/activate
    
    # Upgrade other tools. (Optional)
    pip install --upgrade pip
    pip install --upgrade setuptools
    
    # Install setup.py requirements.
    (env) $ pip install -r build-requirements.txt
    
    # Install Apache Beam package in editable mode.
    (env) $ pip install -e .[gcp,test]
    
    

    For certain systems, particularly Macs with M1 chips, this installation method may not generate urns correctly. If running python gen_protos.py  doesn't resolve the issue, consult https://github.com/apache/beam/issues/22742#issuecomment-1218216468 for further guidance.

On Windows

  1. Use the following code:

    Code Block
    languagebash
    > c:\Python37\python.exe -m venv c:\path\to\env
    > c:\path\to\env\Scripts\activate.bat 
    # Powershell users should run instead: 
    > c:\path\to\env\Scripts\activate.ps1 
    
    (env) > pip install -e .[gcp,test]


  2. You can deactivate the virtualenv when done.

    Code Block
    languagebash
    (env) $ deactivate


...