Skip to content

tb when using Python3 venv #406

Closed
Closed

Description

@JohnSpeno

Using python-mode within a python 3 virtualenv has an issue:

% vim
Error detected while processing /Users/speno/.vimrc:
line 224:
Traceback (most recent call last):
File "", line 8, in
IOError: [Errno 2] No such file or directory: '/Users/speno/Documents/venvs/
pika/bin/activate_this.py'

It's true. The virtualenvs created using python3's pyvenv command do not have a bin/activate_this.py file.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. nitipit commented on Jun 5, 2014

    @nitipit

    Quick fix for now by copying activate_this.py from python2 virtualenv could help, I guess :9.

  2. sdlarsen commented on Nov 11, 2014

    @sdlarsen

    Would indeed be nice with a fix.

  3. makmanalp commented on Dec 4, 2014

    @makmanalp

    +1 here. The thing is, when the virtualenv is activated and you run vim in it, you should already be in the virtualenv and so would one really need to run activate_this?

    e.g. http://bugs.python.org/issue21496

  4. ypomortsev commented on Jan 12, 2015

    @ypomortsev

    +1

  5. egoexpress commented on Feb 10, 2015

    @egoexpress

    +1
    Creating 'Scripts' and touching 'Scripts/activate_this.py' is a workaround but it would be better if python-mode would properly support Python3 venv.

  6. relativistic commented on Feb 12, 2015

    @relativistic

    This also seems to be a problem using python 2 if you use Enthought's canopy. Canopy uses a backport of venv:
    https://support.enthought.com/entries/21802240-Use-venv-not-virtualenv-with-Canopy-Python

    Using enthought's canopy, I get:

    [Pymode]: error: [Errno 2] No such file or directory: '/Users/cpl29573/Library/Enthought/Canopy_64bit/User/Scripts/activate_
    this.py'
    
  7. gilgamezh commented on Mar 18, 2015

    @gilgamezh

    +1

  8. perseus-fyi commented on Apr 3, 2015

    @perseus-fyi

    +1

  9. yoshiya0503 commented on May 20, 2015

    @yoshiya0503

    +1

  10. toejough commented on Jul 28, 2015

    @toejough

    +1

  11. renodesper commented on Aug 28, 2015

    @renodesper

    +1

  12. c4traz commented on Nov 3, 2015

    @c4traz

    +1

  13. mvasilkov commented on Nov 14, 2015

    @mvasilkov

    I second this issue very much.

  14. k3rry0n commented on Nov 15, 2015

    @k3rry0n

    +1

  15. kuc2477 commented on Nov 19, 2015

    @kuc2477

    +1

  16. tony commented on Dec 17, 2015

    @tony

    +1

    Or else python 3 is pretty much broken.

  17. searene commented on Dec 29, 2015

    @searene

    +1

  18. tony commented on Dec 30, 2015

    @tony

    #609 did the trick for me on Neovim, vim +python3 and also preserves python 2 completion.

  19. added a commit that references this issue on Jan 11, 2016
  20. reven404 commented on Nov 5, 2016

    @reven404

    I have also encountered this problem.
    the main reason for this problem is the python3 venv module to use the absolute path in the virtual environment configuration.
    check <virtual environment name>/bin/activate, found VIRTUAL_ENV, modify the correct path will be fix this problem. see below:

    VIRTUAL_ENV = "/ Users /../../<virtual environment name>"
    Export VIRTUAL_ENV¬
    

    and then, reactive the virtual environment.

  21. stale commented on Feb 13, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  22. stale commented on Mar 6, 2018

    @stale

    Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions