Author Topic: Python and env  (Read 363 times)

akmiles

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Python and env
« on: March 10, 2018, 07:03:31 pm »
I am just staring to use slickedit - really cool. However, I have an existing project in a venv. The virtual environment works fine in the command line, but in SlickEdit all my modules show as not installed. How do I make sure my venv is active in slickedit? Thanks
« Last Edit: March 10, 2018, 07:36:38 pm by akmiles »

ebbe

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Re: Python and env
« Reply #1 on: March 10, 2018, 09:24:47 pm »
I ran into this problem last year and got this piece of advice:

Take the -S out of the debug command by removing it from ~line 694 in "C:\Program Files\SlickEdit Pro 21.0.2\macros\pythonopts.e" then save the macro file and reload it using 'Macro > Load Module...' and navigate to pythonopts.e.

It worked for me at least.

Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 717
  • Hero Points: 46
Re: Python and env
« Reply #2 on: March 10, 2018, 09:46:22 pm »
Note that we removed the -S by default in v22. Not sure which version you're on.

++rodney

akmiles

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Python and env
« Reply #3 on: March 10, 2018, 10:22:01 pm »
Thank you! Yes I noticed the -S was gone. But I still cant activate my virtual environment. I tried telling SlickEdit to run source activate ... on workspace open but nothing. I still cant use any of my modules; all I get is errors.

I just noticed - slicked is using python2, but I have it pointing to 3.6
« Last Edit: March 10, 2018, 10:30:36 pm by akmiles »

Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 717
  • Hero Points: 46
Re: Python and env
« Reply #4 on: March 10, 2018, 11:56:28 pm »
We support python 2.x and 3.x. Make sure you set the path to the python interpreter from Build>Python Options. It is global to all python projects.

Are you trying to debug or just run (Build>Execute)?

I'll have to refresh my memory about venv. I seem to recall helping somebody out with that at one point.

akmiles

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Python and env
« Reply #5 on: March 11, 2018, 08:48:23 pm »
Actually I managed to get it running by trial and error. You ave to be very careful how you set the Python version. I was always setting it to the one in venv, but that was a softlink that was resolving and did not work.  When I made sure I entered the softlink all is now well. This is an awesome editor. I love it - going to by a copy to use on my class that I teach.