问题
I want to start a Flask app. I installed virtualenvwrapper to manage the packages but I can't let Atom know that the current project should use the virtualenv's python binary.
from flask import Flask, render_template
Using Atom's script runner, I get an "ImportError: No module named flask".
I don't want the hassle of having to change to a terminal to run the app
回答1:
Have you tried the virtualenv package for Atom?
回答2:
In Linux:
Start your virtual environment python.
Launch atom from your python virtual environment.
(EVP) abc $ atom
That's all.
回答3:
I am the creator of a new package that adds support to virtualenv inside Atom: Atom Python Virtualenv
You can select a virtualenv, create a new one or deactivate, all of this inside Atom.
Feel free to contribute to the project on github.
回答4:
I played around with linter-pylint 2.1.1 package installed in Atom 1.38.2 x64 and work a lot in virtual environments (using conda activate). I got Pylint and Atom to play nice (so far!) with the following settings. You need to check the "Disable Execution Timeout", otherwise it likely will timeout.
来源:https://stackoverflow.com/questions/36706039/can-atom-work-with-python-virtualenvwrapper