Pycharm can not auto complete selenium package - selenium

I install selenium through Python pip and write a simple file called crawlTest.py, it works well.Later, I install Pycharm and try to auto complete method from selenium, but it doesn't work.
I guess Pycharm didn't know where I install selenium and an external library is needed.But I try by myself and search on google and StackOverflow, I didn't get proper solution.
I have read the flowing posts, but still not work. It is very useful and
time-saving for those who use selenium and Pycharm if some one could give me .
here is post list I hava viewed:
How to get PyCharm to auto-complete code in methods?
PyCharm doesn't auto-completes very simple cases such as: import pickle

I install selenium by python pip, and it works with python3.5,but not python 2.7. so I changed my project interpreter as python 3.5 in Py . Now it works!

for use auto-complete Pycharm feture go to "File\Setting\Project:" add new interpreter and select you instaleed python directory.

Related

Import pandas could not be resolved from source Pylance(reportMissingModuleSource)

I've been trying to use the packages pandas, numpy, matplotlib, seaborn in my "Visual Studio Code", but the program keeps showing me the following message:
"import pandas could not be resolved from source Pylance(reportMissingModuleSource)"
Previously to Visual Studio Code I installed "Anaconda" to use Jupyter, and now it says that i have the existing packages (pandas, numpy...) but keeps appearing this message that doesn't allow me to use pandas in my Visual Studio.
Anyone could help me to solve this issue?
I tried installing again all the packages to check if they didn't exist but apparently are installed all of them but in another route. I can't find how is the way to put them so the Visual Studio Code recognizes them and I can use them.
I also received similar an error on my IDE VSCode and currently using mac m1 .First we need to make sure that the python3 interpreter version from terminal version is the same with our python version selection in VSCode.
open terminal.
type 'python3'
then you will see your python version.(my python3 version is 3.9.12)
python3 version
open your IDE VSCode
open any/current folder that related to python project on IDE VSCode
Check your python version at the bottom right on IDE VSCode (in my case the python version is 3.10.64)
change or switch VSCode python version from 3.10.64 to 3.9.12 (same with your python version on your pc)
done
I also had this problem and it was because of version mismatches.
I had installed Python AND Anaconda. If anyone else has done this and gets this error, you need to uninstall both. Then install Anaconda only; Python (the compatible version) is installed as part of that process.
See https://docs.anaconda.com/anaconda/install/windows/
Also, you can click on the interpreter version at the bottom left corner of the screen (Vs.code 2022) it should show a dropdown menu with a list of the available and selected python interpreter. Click on add interpreter path and paste the path to the python interpreter with all the required modules installed and click enter. This should resolve the problem.
I re-entered the path to Python interpreter and warning disappeared. Hope that helps you.
Another way I solved this issue having followed every other installation process to the letter was deactivating Pylance. Works a (py)charm now.
I encountered this problem in VSCode under remote to WSL2 of Windows 10. The Python version is correct as interpreter (3.9.13) and the terminal in VSCode is also under the same envs (ie. VSCode ran "conda activate xx" and (xx) is shown in prompt)
Originally, I tried to install the pandas by the following command.
sudo apt-get install python3-pandas
Pandas was installed successfully as stated in the terminal but the problem is still there.
When I try to install pandas by the following command, the problem solved.
pip install pandas

Error when importing NumPy in PyCharm

I have installed NumPy using pip install and it's working fine while using it in the python interpreter on the command line. But whenever I try
import numpy in PyCharm it throws an error module not found.
I already set the right path in the project interpretor and the import numpy command is working fine with other IDEs such as Syder or Jupyter notebook but it doesn't work in PyCharm.
I found a YouTube video that worked for me in importing a package into PyCharm. First, click on the File menu, then click on Settings, then click on Project Interpreter. Look for a + sign to the right and click on that. That allows you to add a package. Then search for your package of choice (I wanted numpy) in the Search bar at the top. Click on the name, and then at the bottom click on Install Package. After a few minutes, it will say, package successfully installed, and sure enough it was. I was able to import numpy the usual way in PyCharm.
Did you install official Python or Anaconda/Miniconda?
I assume PyCharm created either a virtualenv or a conda env, or an isolated Python environment that does not have NumPy installed.
You should either use your global environment instead of virtualenv:
Settings, Project: project-name / Project Interpreter, https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html
Or install NumPy in your virtualenv or conda env.
This is more complicated. If you open Terminal in PyCharm and it says (project-name) in your prompt, try pip install numpy.

Sikulix and Selenium integration in Pycharm project

Looking for step-by-step instructions how to integrate Sikulix with Selenium in Pycharm IDE. Would like to combine Sikuli and selenium webdriver for unittesting.
I have already downloaded SikuliX as standalone IDE for Jython2.7. In my Pycharm IDE I have some sikuli packages available. See attached. I do not know which ones to download. Also, still confused if I need to dowload Jython or not.
Please help.
1) Download selenium python bindings from https://pypi.python.org/simple/selenium/
2) Extract that to a folder and run python setup.py install from there.
3) Now, copy the generated "selenium" folder to your \python\Lib and \jython\Lib root directories
4) Test your code by typing "from selenium import webdriver" in your file.
5) For sikuli, just edit your pycharm run configuration and include this in your environment variables "CLASSPATH=C:\Sikuli\sikulixapi.jar;PYTHONUNBUFFERED=1"
6) Use jython as your project interpreter

Load methods/properties/module from Scikit-Learn in PyCharm

I am using PyCharm 3.4.1 (professional version). And I am exploring Scikit-Learn, NumPy etc. But unfortunately I can't get methods/properties/module in PyCharm when I write code with any installed package instead of Python core. Though when I import any module at the beginning of any .py file, it shows the corresponding methods/modules after pressing dot(.), but in code, PyCharm does not show the list after pressing dot(.).
How I can get all things after pressing dot(.)?
Thanks!

How to run python scripts against selenium grid

I am able to run python scripts throgh selenium rc.
I dont know to run these scripts in selenium grid.I am not able to get the correct answer from anywhere.is it possible to run python scripts from selenium eclipse.
Please anyone provide me the solution as soon as possible.
Thx.
first of all you have to install selenium with this code:
pip install -U selenium
Alternately, you can download the source distribution from PyPI (e.g. selenium-2.53.1.tar.gz), unarchive it, and run:
python setup.py install
both of the methods described above install selenium as a system-wide package That will require administrative/root access to there machine. You may consider using a virtualenv to create isolated Python environments instead.
You're asking a lot of things that don't really make sense. E.g., there is no such thing as "selenium eclipse." Anyway, I'll try to answer the best I can.
Your Python scripts should have the client connect to the Selenium Grid Hub instead of a specific RC Server. The hub is then responsible for dispatching the request to any registered nodes in the grid. There is nothing Python-specific involved with grid.