I installed selenium through the command line and imported the library on Intellij. At first glance, it seems to be fine, because the software returns "unused import statement" Unfortunately when I use the module in any way it returns an error. No module named 'selenium'
I tried to pip install selenium again, and got
Requirement already satisfied: selenium in
c:\users\user\appdata\local\programs\python\python36-32\lib\site-packages
This is the code I was trying to run:
import selenium
help(selenium)
which returns the same error. It does not say the module does
not exist before
I run the code like it would if I would just write random import.
You need to ensure the project interpreter for this project is configured to use your system Python. The JetBrains documentation for doing this is here. In IntelliJ, essentially you need to go to the project structure settings and configure the Python SDK for the project or module (whichever is needed).1
1 Instructions will vary if you are using a different JetBrains IDE than IntelliJ, but this is what you specified in your question.
Related
my code is having an issue in which when i run the program it gives the error message :
ImportError: No module named 'mouse'
this happens even though the module is installed???
Code below:
import mouse
print(mouse.get_position())
If you can't use the module globally, please try to install it and use the module using a virtual environment as an example you can use anaconda.
If you are using IDE like PyCharm make sure you download the package on the IDE.
In pycharm go to Setting->Python Interpretor->Click + ->search your package name (in this case mouse) -> install the package
Hi i'm recently working on a module in python (package named pykiwoom)
I installed a module in conda 32-bit environment pip install pykiwoom and tried to import this
from pykiwoom.kiwoom import Kiwoom
This works perfectly fine when I execute this in python console in pycharm
However, when I try this in terminal error occurs
ModuleNotFoundError: No module named 'pykiwoom.kiwoom'; 'pykiwoom' is not a package
internal structure of package pykiwoom looks like this
pykiwoom
init.py
kiwoom.py
parser.py
Can somebody tell me why this error occurs?
I think where you install your package is important in your case. You can check the packages installed using pip list in terminal, and check if you find it there.
This solution provides overview of how to setup your files as packages and modules.
Nevertheless, I think if you install your package in the terminal using pip, you could possibly access it.
I have a Python/Selenium project where I need to run code from a different file than the main one with from ABC import XYZ, but in the same driver (without opening a new window). From what I found, it seems that the idea is to make a singleton file, which I've done using the code from their website.
Initially, I've been getting "lib not found", which was fixed with pip install robot, but now I'm running into "No module named 'robot.api'" and I can't seem to find the issue. Tried pip install robotframework-databaselibrary but that wasn't it.
What am I missing here? FYI, my singleton.py is in the same folder as the other two .py files and my first line "from robot.api import logger" is greyed out in PyCharm.
You have installed the wrong package - robot looks like a Django library, while you need robotframework:
pip install robotframework
But before installing the correct one, remove the robot package - you'll have two with the same name, and the "wrong" probably resolves first.
I've installed the requests module for Python3 on my system, and appears to have installed completely fine. When I run a script involving use of said package on PyCham using Python3 interpreter, it runs without a problem. However, when executed outside this environment, this error pops up:
ImportError: no module named requests
This happens despite PATH containing Python34, which invokes correctly when call via cmd, and me double checking the installation via pip. Is there any possible area you could point me to that could resolve this problem?
Thanks in advance.
Maybe you have two Pythons installed. One is used by PyCharm (and it has requests) and second is used in cmd. Beside pip can be part of Python used by PyCharm not Python used in cmd.
I'm trying to follow this tutorial and I'm getting the following error:
ImportError: No module named django.core.management
I'm completely new to python. I believe Visual studio is using a version of python I already had installed in c:\Python27, could that be causing a problem?
Someone mentioned in a link I found that they had to copy the 'django' folder to the project folder, but I don't know where that would be. I don't even know what the error means really unless there's a missing package (like dll or assembly in .NET?), but I don't know what paths python would use to try to find a package or even what one would look like.
I see there's a PYTHONPATH environment variable that I don't have declared, should I declare that? Should it point to the C:\Python27 directory?
First, do you have checked your "Python Environment" in your project folder? It may seems like...
Here you may find your django with version. If you dont find it then compile setup.py from django folder again with desire python version. And then right click on "Python Environments" from your project and click on "Add/Remove Python Environments" to select python version.
Ok with a lot of fooling around I found this directory:
%LOCALAPPDATA%\Microsoft\Web Platform Installer\installers\PythonDetectInstalls
In a mangled sub-folder there is a powershell script DetectPythonInistalls.ps1 that has these two lines for checking if python is installed already:
$regKey = "hklm:SOFTWARE\Python\PythonCore\$pythonVersion\InstallPath";
$correctRegKey = "hklm:SOFTWARE\Wow6432Node\Python\PythonCore\$pythonVersion\InstallPath";
Uninstalling all my pythons did not remove these keys. After removing these registry keys with regedit, WPI allowed me to install its own version of python 2.7 and all the other goodies to go with the Windows Azure Python SDK and it worked.