账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    Python虚拟环境virtualenvwrapper
    48
    0

    为什么我virtualenvwrapper创建虚拟环境指定Python3版本后,进入虚拟环境中Python2仍可以使用?

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • Virtual environments are useful for managing multiple versions of Python and other dependencies. One popular Python package for creating virtual environments is virtualenvwrapper.

      virtualenvwrapper is a Python library that allows you to create and manage virtual environments in a standardized way. It provides several features, including:

      1. Command-line interface: virtualenvwrapper allows you to create, activate, deactivate, and delete virtual environments from the command line.
      2. Environment creation: virtualenvwrapper provides a simple syntax for creating virtual environments, including specifying the Python version, the name of the environment, and any dependencies required.
      3. Environment activation: virtualenvwrapper allows you to activate a virtual environment using the activate script located in the virtual environment's directory.
      4. Environment deactivation: virtualenvwrapper allows you to deactivate a virtual environment using the deactivate script located in the virtual environment's directory.
      5. Environment sharing: virtualenvwrapper allows you to share virtual environments between multiple users or projects using the environment files.

      To install virtualenvwrapper, you can use pip:

      pip install virtualenvwrapper

      Once virtualenvwrapper is installed, you can create a virtual environment using the following command:

      virtualenv myenv

      This will create a new virtual environment called "myenv" with Python 3.6 and all its dependencies installed. To activate the virtual environment, you can use the activate script located in the "myenv" directory:

      source myenv/bin/activate

      Once activated, you will see a command prompt with the name of the virtual environment displayed in it. To deactivate the virtual environment, you can use the deactivate script located in the "myenv" directory:

      deactivate

      You can also share virtual environments between multiple users or projects by copying the environment files from one user's virtual environment to another. For example, you can create a virtual environment called "myenv" for a project and then copy the environment files to another project called "myproject". To activate the virtual environment in "myproject", you can use the activate script located in the "myproject" directory:

      source myproject/bin/activate

      Once activated, you will see the same commands as you would in "myenv".

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部