Can't import youtubesearchpython into my code - python

Pip install youtube-search-python
And than when i try :
from youtubesearchpython import *
I see an error tells me that the module not found
What is the problem

Are you using anaconda or conda ? If not you can install it here.
I would recommend to built an environment (here : myenvname) first with all the available packages you need. You will be able to install youtube-search-python with conda-forge channel.
conda create --name myenvname --channel=conda-forge youtube-search-python
conda install -n myenvname python
conda install -n myenvname scipy
conda install -n myenvname matplotlib
...
conda activate myenvname
After that you choose your myenvname for your environment with specific packages installed. Feel free to consult the conda documentation available at the same link as above.

Related

how to install multiple packages in one line using conda?

I need to install below multiple packages using conda. I am not sure what is conda-forge? some uses conda-forge, some doesn't use it. Is it possible to install them in one line without installing them one by one? Thanks
conda install -c conda-forge dash-daq
conda install -c conda-forge dash-core-components
conda install -c conda-forge dash-html-components
conda install -c conda-forge dash-bootstrap-components
conda install -c conda-forge dash-table
conda install -c plotly jupyter-dash
I believe you can just list them all one after the other:
conda install -c conda-forge dash-daq dash-core-components
Why some packages have to be installed through conda forge:
Conda official repository only feature a few verified packages. A vast portion of python packages that are otherwise available through pip are installed through community led channel called conda-forge. You can visit their site to learn more about it.
How to install multiple packages in a single line?
The recommended way to install multiple packages is to create a .yml file and feed conda this. You can specify the version number for each package as well.
The following example file can be fed to conda through conda install --file:
appdirs=1.4.3
asn1crypto=0.24.0
...
zope=1.0
zope.interface=4.5.0
To specify different channel for each package in this environment.yml file, you can use the :: syntax.
dependencies:
- python=3.6
- bagit
- conda-forge::beautifulsoup4

ModuleNotFoundError: No module named 'snorkel.labeling'

I installed snorkel using conda and when I try to run - from snorkel.labeling import labeling_function it throws the following error - ModuleNotFoundError: No module named 'snorkel.labeling'.
I tried looking up for a solution on Github, but unfortunately, I couldn't follow through. I have also tried installing nb_conda_kernels, to make all your conda environments available in jupyterbut it didn't help. Also tried creating a separate env, installing snorkel and launching jupyter notebook from the snorkel's environment, and it didn't work either. Any form of help is much appreciated!
Thanks in advance!
Try these install instructions:
conda create --yes -n snorkel
conda activate snorkel
conda install pytorch==1.1.0 -c pytorch
conda install snorkel==0.9.0 -c conda-forge
Or these, listed here:
# [OPTIONAL] Activate a virtual environment
conda create --yes -n spam python=3.6
conda activate spam
# Install requirements (both shared and tutorial-specific)
pip install environment_kernels
# We specify PyTorch here to ensure compatibility, but it may not be necessary.
conda install pytorch==1.1.0 -c pytorch
conda install snorkel==0.9.5 -c conda-forge
pip install -r spam/requirements.txt
# Launch the Jupyter notebook interface
jupyter notebook spam
Please try the following:
For pip users
pip install snorkel
For conda users
conda install snorkel -c conda-forge

Setup a virtual environment for pip work and conda work

OS - Ubuntu 16.04 LTS
I want to setup my machine so I have two virtual environments
For pip
For conda
I want to do this so in one virtual environment I can have all libraries that are installed using pip and in the other I can have all my anaconda work/libraries
For pip and conda both I want to a have Python3.6 as default
How can I do this ?
First, install Miniconda. You can then create an environment where you (try to) only use conda
> conda create -n conda_only python=3.6
> conda install -n conda_only numpy ...
And you can also make your 'pip' environment as a conda env, but then only use pip to install packages. For example,
> conda create -n pip_only python=3.6 pip
> source activate pip_only
> pip install numpy ...
I don't know your motivation (benchmarking installation times perhaps?), but it should be noted that in practice it's common to mix conda and pip simply because some packages are only on PyPI. Plus, conda recognizes packages installed by pip.

speedml not working with py-xgboost / conda installed py-xgboost is not recognized by pip

I have install py-xgboost from anaconda using:
conda install py-xgboost
where it is shown up when I run
conda list
conda env export
But from pip it doesnt show up:
pip freeze
Is there a way to make pip able to 'see' xg-boost that is installed from a conda package? The reason I need this is because I need speedml which has a dependency on xg-boost and speedml is only available to me from pip (the enterprise anaconda repo do not have speedml).
Thanks!!
This can actually be solved by using
--no-deps
as described in this SO question
So for example what I need is speedml but it requires xgboost then I create the conda environment, installed py-xgboostm, and run the following in same conda env.:
pip install speedml --no-dependencies
And afterwards speedml works!

How to install python iexfinance package on Anaconda?

What is the exact command for installation of the python iexfinance package when using the Anaconda command prompt? Using the pip commands mentioned under "install" here does not work. https://pypi.python.org/pypi/iexfinance
It seems this package is not available through anaconda distribution.
Usually, besides the conda install <package> command, you have the alternative:
conda install -c conda-forge <package>
In your case, you can create a conda environment:
conda create --name <yourenv> python=3.5
then source activate <yourenv>,
and inside this environment you install your package, like so:
pip3 install iexfinance
then proceed to install other packages with conda install <package> as you see fit.

Categories

Resources