trying out the VSCode editor, but immediately ran into a problem. I have a django 2.0.5 installation in a virtual environment, however, the out of the box linter yells at me. This is one of the errors (better said, warnings, because the server is running fine, and everything gets displayed properly) E0611:No name 'path' in module 'django.urls'
I'm sure it's easy to solve, but it's beyond me at this point
Related
So I am trying to create a chatbot in pycharm so I set up all the code and when I tried to run it, it gives me a error message saying can't find 'main' module in 'C:\Users
So I tried fixing it by setting up a new folder called virtual environment yet it gives me the same error
On the off chance it doesn't give me that error it tells me it cannot input chattterbot so I go to project interpreter to try and install it, it gives me the error message
Error occurred when installing package 'Chatterbot' I dont get why this does it while chatterbot-corpus works perfectly fine.
I tried as I said making a new virtual environment but that didnt work so after switching the new virtual environment I made and trying to put chatterbot in manually it didnt work and nothing showed. So going back to the original environment that was created when I started this project. But the same thing keeps happening it just wont install even if other programs install no problem. I looked this problem up and I found one post saying it might be setuptools fault so I down graded to the version that they said it would work but to no avail. It always comes up as Error occurred while installing package 'Chatterbot' I dont know if its something wrong with the files on my computer or the way im trying to install chatterbot. The major problem that really stumps me is that this seems to be a problem for only chatterbot and nothing else and I cannot figure out for the life of me why.
I'm new to Python and programming in general, i'm learning my first steps in VScode. I was trying to create a virtual environment which I couldn't activate for some reason. I tried to solve this with a few tricks I found on stackoverflow, like disabling python.experiments.
It still didn't work so I thought I would just start without a venv, but then the python extension was not working anymore. VScode told me: "Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information'"
The errors I found where: "Activation extension 'ms-python.python' failed: e.endswith is not a function"
I uninstalled the Python and Pylance extension, accordinly I deleted all the related files before installing it again.
I was expecting VScode to be loading the Python extension succesfully again, but I still encountered the same error for which I don't know how to solve it.
Then I deleted VScode entirely before installing it again, unfortunately still the same issue..
I am trying to learn Python and debug code for the first time in VS Code (latest edition). I have anaconda running and the code I have runs fine by itself but now I need to know how to update the code and debug it for the first time.
I keep getting the following error related to NumPy:
Exception has occurred: ImportError
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
The Python version is: Python3.7 from "C:\Miniconda2\envs\myproject_flask\python.exe"
The NumPy version is: "1.18.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed: The specified module could not be found.
In the Miniconda path above the Python.exe is version 3.7.7. I tried to install NumPy like so in myproject directory:
(myproject_flask) c:\MyProject\source\MyProject.Flask>conda install numpy=1.18.5
I still get the same error when I go to F5 to debug and run to a breakpoint.
Need help with my environment.
I need to use VS Code in my Windows environment with Anaconda.
You should launch VS Code from Anaconda Navigator so that the environment is initialized.
When you have problems with importing the numpy C-extensions in Anaconda it's very likely that your virtual environment hasn't been activated. Having just Python on the path is not good enough. You also need access to the libraries. This is what the activation does.
When you are running/debugging code you should see a terminal open. You can tell from the prompt
(myproject_flask) C:\MyProject
that conda has been activated. Sometimes this just takes a bit too long for VSCode. So simply push the start button a second time.
Note that the Code Runner extension in VSCode is also known to cause this kind of problems.
However, I wonder why you are using Miniconda2 with Python3, although in general this should work.
I was getting the error even after adding all the anaconda paths, it was due to VScode running the code in the python debugger terminal which is not able to enter the conda environment.
This worked for me:
press ctrl+Shift+P > Type Terminal:Select Default profile > Select Command prompt
after this code ran in Command prompt by default, inside the environment.
I've using Pycharm for a while now. And recently I noticed that the import os line is highlighted in red with an error message of No module named os. (Using Python 3.8.4)
But when launching the script(Via PyCharm) it's importing it without any errors.
The exact same thing is also happening with a module named webbrowser.
Why does it say this? And how do I fix this?
I am using the Python from the Microsoft Store. And changing the Interpreter from ...\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe to ...\AppData\Local\Microsoft\WindowsApps\python.exe fixed it.
(The first directory gave me an invalid SDK error)
Or maybe just the fact that I remove and added back the Interpreter was the thing that fixed it.
I am using python 3.8.5 on a mac, and found the trick to be to quit pycharm, delete the .idea file in the project directory and restart pycharm.
This is embarrassing to admit, but I just continue to struggle with setting up my Python environment on an Ubuntu install.
Sometimes I get it to work fine. But here's the problem:
I feel like whenever I sit down to do some hobby hacking on a python project, I end up spending hours on end just trouble shooting inconsistencies with my python installation. Right now I keep getting an error message of:
ImportError: cannot import name urandom
when trying to import a module called googleplaces (https://github.com/slimkrazy/python-google-places).
But it's always something that causes me to go on an endless snipe hunt for the proper configuration of this that or the other.
I just want to work on the project, not plumb around endlessly in forums.
Which brings me to my point: How do I completely nuke my existing python setup (including virtualenv, pip, easy_install, etc. etc.) and just start from a completely clean slate? I have already tried reinstalling everything python from synaptic, but no success, still getting error.
UPDATE: I've reinstalled virtualenv and that seems "ok" so far. Found that my import error is a permissions problem, if I import in the interactive using sudo, it passes fine. How should I be correcting my permissions so I don't have to run sudo? (Probably close this and start a new question.)