PyLint "Unable to import" error - how to set PYTHONPATH?

I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level,...

How to get a list of all the Python standard library modules?

I want something like sys.builtin_module_names except for the standard library. Other things that didn't work: sys.modules - only shows modules that have already been loaded sys.prefix - a path...

What is the easiest way to remove all packages installed by pip?

I'm trying to fix up one of my virtualenvs - I'd like to reset all of the installed libraries back to the ones that match production. Is there a quick and easy way to do this with pip?

Where should virtualenvs be created?

I'm confused as to where I should put my virtualenvs. With my first django project, I created the project with the command django-admin.py startproject djangoproject I then cd'd into the...

How to install a package inside virtualenv?

I created a virtualenv with the following command. mkvirtualenv --distribute --system-site-packages "$1" After starting the virtualenv with workon, I type ipython. It prompts me WARNING:...

pip3: command not found but python3-pip is already installed

I can't use pip3 though python3-pip has already been installed. How to solve the problem? sudo pip3 install virtualenv sudo: pip3: command not found sudo apt-get install python3-pip Reading...

Cannot switch Python with pyenv

I would like to use pyenv to switch python2 and python3. I successfully downloaded python2 and python3 and pyenv with following codes. brew install pyenv brew install pyenv-virtualenv pyenv...

Why is python setup.py saying invalid command 'bdist_wheel' on Travis CI?

My Python package has a setup.py which builds fine locally on Ubuntu Trusty and on a fresh Vagrant Ubuntu Trusty VM when I provision it like this: sudo apt-get install python python-dev...

How can I 'clean up' a virtualenv?

If I want to keep my venv as clean as possible how can I clean up the stuff I don't need? Let me lay out an example... Say I try a bunch of new modules... pip install foo pip install bar pip...

ImportError: No module named app_manage when running Django with django-cms installed

I had a local working django project based on django–cms. its not working anymore when i activate virtualenv. Here full Error message: Ajays-MacBook-Pro:django-cms-release-3.3.x ajayvelu$ python...

Error creating virtualenv on Mac OSX sierra

My problem has nothing to do with conda. ~$ virtualenv venv New python executable in /Users/john/venv/bin/python Installing setuptools, pip, wheel... Complete output from command...

Using Pip to install packages to Anaconda Environment

conda 4.2.13 MacOSX 10.12.1 I am trying to install packages from pip to a fresh environment (virtual) created using anaconda. In the Anaconda docs it says this is perfectly fine. It is done the...

What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?

Python 3.3 includes in its standard library the new package venv. What does it do, and how does it differ from all the other packages that seem to match the regex (py)?(v|virtual|pip)?env?

Why do I keep getting 'ImportError: cannot import name db'?

I am following this tutorial: getting started with flask-login. However I am stuck at step 5 where I start to use SQLAlchemy. I believe the problem might be circular importing, based on what I...

ModuleNotFoundError: No module named 'requests'. But 'requests' already installed

Trying to import 'requests'. Has it installed via pip3 install requests? But still, have this error. C:\Users\Vikentiy>pip3 list Package Version ---------- ---------- certifi ...

WSL Conda Environment in PyCharm

I'm trying to set up a new dev environment on Windows 10. Let me set the stage with some key points: I am using Ubuntu through Windows Subsystem for Linux (WSL). I have Anaconda3 installed on...

Auto activate virtual environment in Visual Studio Code

I want VS Code to turn venv on run, but I can't find how to do that. I already tried to add to settings.json this line: "terminal.integrated.shellArgs.windows":...

How to setup a virtual environment for python in Visual Studio Code using the command line

I am a very new programmer trying to learn Flask now that I've learned the basics of Python. I am following this tutorial https://www.youtube.com/watch?v=Z1RJmh_OqeA&t=355s ... I am stuck at...

Issues with pyenv-virtualenv: Python and PIP not changed when activating / deactivating virtual environment

I installed pyenv-virtualenv using Linuxbrew (Homebrew 2.2.5) on my Ubuntu 16.04 VPS. The pyenv version is: 1.2.16. Now when I do a test like this: pyenv install 3.8.1 pyenv virtualenv 3.8.1...

OpenCV-python not importing

I am using Pydroid to code in android. Though it is an ARM machine so I downloaded OpenCV-python wheel from PiWheels and successfully installed it using pip. But i can't import OpenCV anyways....

smtplib.SMTPServerDisconnected: Connection unexpectedly closed

i am trying to execute the following code on terminal with django.core.mail send_mail send_mail('some title','some text','[email protected]',['[email protected]']) but after execution the...

python pip defaulting to user installation because normal site-packages is not writeable

I am setting up a clean version of Ubuntu under WSL2, it needs to run python 3.7 because of some dependencies. The goal is to have a project folder with a virtual environment in it, and to be able...

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding, when trying to start uwsgi

I am trying to start my uwsgi server in my virtual environment, but after I added plugin python3 option I get this error every time: !!! Python Home is not a directory: /home/env3/educ !!! Set...

Virtual Environment Setup in Visual Studio Code -- Workon command

I am trying to activate the Python virtual environment using workon command in Visual Studio Code. Typing command workon is listing all the virtual environments already available, but when I am...

Error "Failed to initialize virtualenvwrapper." (WSL Windows 10)

Intro In my WSL (Wsman Shell commandLine, version 0.2.1) on Windows 10, I got pyenv installed and try to use pyenv-virtualenvwrapper. Yet, I can't seem to get it up and running, not even with the...

PYPY venv pip ERROR: ModuleNotFoundError: No module named 'pip._vendor.six'

I created venv according to pypy install site: System-Product-Name:~# virtualenv -p "/home/x/pypy3.8-v7.3.7-linux64/bin/pypy" ve created virtual environment PyPy3.8.12.final.0-64 in 102ms...

Installing wxPython on Windows: DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required

I have installed: Python 3.10.1 PyCharm Community 2021.3 Visual Studio Build Tools 2022, including: C++ Build Tools Core Features C++ 2022 Redistributable Update C++ core desktop features MSVC...

How to source or activate a virtual environment within an IPython shell?

I use IPython and the %bookmark magic command but the limitation is that I need to exit the IPython shell to activate a virtual environment and then relaunch IPython. Is there a way, built into...

PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version, has anyone seen this before

/home/user/.local/lib/python3.8/site-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release

Tensorflow setup in R | Error: Failed to load the native TensorFlow runtime

For the last 5 days, I am trying to make Keras/Tensorflow packages work in R. I am using RStudio for installation and have used conda, miniconda, virtualenv but it crashes each time in the end....