Scrapy add external library - scrapy

How can we add external library to Scrapy.I want to add the follwing library to Scrapy:
https://github.com/scrapinghub/scrapylib
How can I add it?

I'm not entirely sure why pip can't install scrapylib (I updated pip to version 1.4, but the same issue occurred).
A workaround would be to download a zip of scrapylib directly from Github, extract the zip and then run python setup.py install. I was able to install scrapylib and run import scrapylib from the Python interpreter without any errors.

Related

install "pip undetected-chromedriver" for selenium python

I'm trying to make an autofiller using selenium, but it couldn't be done. so I decided to use undetected chromedriver to finish the automation.
I am having some difficulty here to import the undetected-chromedriver.
I already downloaded it by inputting the command line: pip install undetected-chromedriver
But when I put the import undetected_chromedriver as uc, the complier doesn't recognize it.
Below is the Error message after trying to import undetected-chromedriver:
import undetected_chromedriver as uc
ModuleNotFoundError: No module named 'undetected_chromedriver'
Use the following command to check if the undetected_chromedriver package is in the list
pip list
or
pip3 list
Try the following
# navigate into the project directory with your python script
cd presearch
# create virtual environment
python3 -m venv venv
# activate the virtual environment
source venv/bin/activate
# install required pip packages
pip3 install undetected-chromedriver
If you have multiple python versions installed, you might check if you actually installed it in the right one.

Importing cx_Oracle in Jupyter note book gives ModuleNotFoundError

i am using jupyter notebook and i am trying to do sql queries in jupyter book
but i got an error
To install cx_Oracle latest version 8.0.0 in your own laptop, you need the following components already installed:
Python 3x
An Oracle Instant Client version 11g or higher. Refer to download the instant client version to this link
https://www.oracle.com/database/technologies/instant-client/downloads.html
Steps to Download and Install cx_Oracle Package for Python on Windows. In my case, I like better the version available in GitHub
https://github.com/oracle/python-cx_Oracle
1.Click on the Download cx_Oracle link to download the package from Github. It will download a zip file into your laptop.
2.Extract the zip file to a folder on Windows. For example, C:\cx_oracle.
3.Now open the command prompt and change the current directory to the C:\cx_oracle directory to install cx_Oracle package.
4.Then run the following command.
python -m pip install cx_Oracle --upgrade pip
It will install the cx_Oracle package for Python on Windows, and you will get the messages as shown below.
Collecting pip
Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 1.3MB 2.5MB/s
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.0
Important if you have more than one version of Python, use the one associated to Jupyter notebook.
You need to import the package first:
pip install cx-Oracle
In simple words for anaconda users
while installing the package use small case letters source
conda install -c conda-forge cx_oracle
now while importing the package use init cap as
import cx_Oracle

No module named "tensorflow"

I want to build tensorflow with python libraries. Currently I have tensorflow installed but I do not see python packages in /usr/local/lib/python3.6/dist-packages so when I try to import tensorflow module in python terminal, it fails. However, there is library in /usr/lib and C++ programs work.
What is flag/target needed in bazel build?
You can get TensorFlow in python package by:
Directly doing pip install tensorflow: It will install the precompiled version by directly downloading a wheel file.
Build from source code in GitHub using bazel build.
For the second approach, the following steps are needed:
Take the source code from GitHub.
Compile the code using bazel build. It will give the ".whl" file.
Do pip install /tmp/TensorFlow-version-tags.whl
For detailed installation, steps follow this.

Installing pandas without pip

Is it possible to install pandas without installing pip or Is there any other way to use pandas without installing pip.
Thanks in advance.
pip is a package management system used to install and manage software packages written in Python. Many packages can be found in the default source for packages and their dependencies
here is the another way:
Download and unzip the current pandapower distribution to your local hard drive.
Open a command prompt (e.g. Start–>cmd on Windows) and navigate to the folder that contains the setup.py file with the command cd
cd %path_to_pandapower%\pandapower-x.x.x\
Install pandapower by running
python setup.py install
You can get pandas installed using the Anaconda distribution, which includes the Anaconda prompt. After you open an anaconda prompt, you can run the following command:
conda install pandas
which will install the latest version of pandas, or:
conda install pandas=0.20.3
to get a specific version of the package. Another way to do it is to install it with Miniconda, which allows you to avoid downloading the Anaconda installer and hundreds of other packages. More information can be found here: https://pandas.pydata.org/pandas-docs/version/0.23.4/install.html

What is the setup.py file in github repository used for?

How can I run the code in this repository without following their steps, I want to run the main.py file, from the Demo, directly.
What are the setup.py and install.sh files used for?
setup.py is the canonical name for the installer of a Python package. For example, when you run pip install x, pip runs the setup.py of the package you installed. In this case, install.sh is just a shortcut for running setup.py.
There's no way to use a package without installing it, since it won't have what it needs to operate properly.