What are the Python equivalents to Ruby's bundler / Perl's carton?

前端 未结 7 1414
误落风尘
误落风尘 2020-12-22 18:54

I know about virtualenv and pip. But these are a bit different from bundler/carton.

For instance:

  • pip writes the absolute path to shebang or activate s
相关标签:
7条回答
  • 2020-12-22 19:32

    You can use pipenv, which has similar interface with bundler.

    $ pip install pipenv
    

    Pipenv creates virtualenv automatically and installs dependencies from Pipfile or Pipfile.lock.

    $ pipenv --three           # Create virtualenv with Python3
    $ pipenv install           # Install dependencies from Pipfile
    $ pipenv install requests  # Install `requests` and update Pipfile
    $ pipenv lock              # Generate `Pipfile.lock`
    $ pipenv shell             # Run shell with virtualenv activated
    

    You can run command with virtualenv scope like bundle exec.

    $ pipenv run python3 -c "print('hello!')"
    
    0 讨论(0)
提交回复
热议问题