About Soundcloud scraping for uploading music to telegram group - python

I am trying to automatically download the new uploaded file from the below soundcloud link and upload it to a telegram group :
https://soundcloud.com/radio-hamrah-1
so I have googled the:
python script to download from soundcloud and import to telegram
group
and tried the scdl python module by its instruction, but when I have tried its on this colab page I get this error:
!pip3 install git+https://github.com/flyingrub/scdl
!scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship --download-archive archive.txt -c
Collecting git+https://github.com/flyingrub/scdl
Cloning https://github.com/flyingrub/scdl to /tmp/pip-req-build-0g64ql2f
Running command git clone -q https://github.com/flyingrub/scdl /tmp/pip-req-build-0g64ql2f
Requirement already satisfied (use --upgrade to upgrade): scdl==1.6.12 from git+https://github.com/flyingrub/scdl in /usr/local/lib/python3.7/dist-packages
Requirement already satisfied: docopt in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (0.6.2)
Requirement already satisfied: mutagen in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (1.45.1)
Requirement already satisfied: termcolor in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (1.1.0)
Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (2.23.0)
Requirement already satisfied: clint in /usr/local/lib/python3.7/dist-packages (from scdl==1.6.12) (0.5.1)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (1.24.3)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->scdl==1.6.12) (2021.5.30)
Requirement already satisfied: args in /usr/local/lib/python3.7/dist-packages (from clint->scdl==1.6.12) (0.1.0)
Building wheels for collected packages: scdl
Building wheel for scdl (setup.py) ... done
Created wheel for scdl: filename=scdl-1.6.12-cp37-none-any.whl size=19143 sha256=27ca560a7f3947830289d0df167db84137d1554fe1ab740c2afab3db0abedd74
Stored in directory: /tmp/pip-ephem-wheel-cache-agspvyq5/wheels/49/44/6e/a5f6f709e7b231f3639ea9f9fc48a4699b958850715556e7f6
Successfully built scdl
Soundcloud Downloader
Failed to get item...
and when I try by the Docker VPS by this commands:
pip3 install git+https://github.com/flyingrub/scdl
pip3 install ffmpeg
scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship --download-archive archive.txt -c
pip3 install git+https://github.com/flyingrub/scdl
pip3 install ffmpeg
scdl -l https://soundcloud.com/pandadub/sets/the-lost-ship --download-archive archive.txt -c
I get this error :
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
So I asked abut how could i do it by scdl and soundcloude python module.
Update:
Based of my two comment on this question I get different result by using the scdl python module via the above colab page, sometimes it is working and sometimes not, which i guess it is because of soudncloud server setting for preventing huge scraping and needs some delay during the music scraping form the soundcloud.
Thanks.

Related

pip install successful but commands do not work

I am trying to pip install a CLI and it successfully installs.
pip3 install databricks-cli
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: databricks-cli in ./Library/Python/3.8/lib/python/site-packages (0.14.3)
Requirement already satisfied: click>=6.7 in ./Library/Python/3.8/lib/python/site-packages (from databricks-cli) (7.1.2)
Requirement already satisfied: requests>=2.17.3 in ./Library/Python/3.8/lib/python/site-packages (from databricks-cli) (2.25.1)
Requirement already satisfied: six>=1.10.0 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from databricks-cli) (1.15.0)
Requirement already satisfied: tabulate>=0.7.7 in ./Library/Python/3.8/lib/python/site-packages (from databricks-cli) (0.8.9)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./Library/Python/3.8/lib/python/site-packages (from requests>=2.17.3->databricks-cli) (1.26.4)
Requirement already satisfied: idna<3,>=2.5 in ./Library/Python/3.8/lib/python/site-packages (from requests>=2.17.3->databricks-cli) (2.10)
Requirement already satisfied: chardet<5,>=3.0.2 in ./Library/Python/3.8/lib/python/site-packages (from requests>=2.17.3->databricks-cli) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in ./Library/Python/3.8/lib/python/site-packages (from requests>=2.17.3->databricks-cli) (2020.12.5)
But when I go ahead and try to use a command I am given an error that it cannot find the command.
~ databricks --version
zsh: command not found: databricks
I needed the following command.
sudo -H pip3 install databricks-cli

No module named pyVim

I am running Catalina MacOS with python 3.7.5. I am trying to run an ansible script to install a VM. This Requires python >= 2.6 and PyVmomi. I have installed PyVomi and pyVim via pip. Both were installed successfully. When I run the playbook, I get the error message below. Not sure what I am missing.
TASK [Create a virtual machine on given ESXi hostname] *************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named pyVim
fatal: [localhost -> localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (PyVmomi) on MacBook-Pro.local's Python /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python. Please read module documentation and install in the appropriate location"}
ArunJose_Intel is correct. The module is pyvmomi, not pyVim. Although the error indicates that the pyVim library was missing. It was misleading as I could see it in my directory. Following his advice I changed the pip install command to install pyvmomi instead.
pip install pyvmomi
I was able to run the python script with pyVim imported. Thank you Arun.
You might have installed PyVomi and pyVim for the wrong python executable. You have to make sure you are installing via pip to the right python. You are installing the packages to the python3.x present in your machine. What you have to do is to install the pip packages to the python of the playbook
I fixed it.
pip3 install ansible
That made ansible use python3
Sorry for the confusion. I have installed this via pip3, is yes they are installed in the python3 directories.
pip3 install PyVmomi
Requirement already satisfied: PyVmomi in /usr/local/lib/python3.7/site-packages (6.7.3)
Requirement already satisfied: requests>=2.3.0 in /usr/local/lib/python3.7/site-packages (from PyVmomi) (2.22.0)
Requirement already satisfied: six>=1.7.3 in /usr/local/lib/python3.7/site-packages (from PyVmomi) (1.13.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/site-packages (from requests>=2.3.0->PyVmomi) (2019.9.11)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/site-packages (from requests>=2.3.0->PyVmomi) (1.25.7)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.7/site-packages (from requests>=2.3.0->PyVmomi) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.7/site-packages (from requests>=2.3.0->PyVmomi) (2.8)
pip3 install pyVim
Requirement already satisfied: pyVim in /usr/local/lib/python3.7/site-packages (3.0.2)
Requirement already satisfied: docopt in /usr/local/lib/python3.7/site-packages (from pyVim) (0.6.2)
Requirement already satisfied: prompt-toolkit<3.1.0,>=2.0.0 in /usr/local/lib/python3.7/site-packages (from pyVim) (3.0.2)
Requirement already satisfied: pyflakes in /usr/local/lib/python3.7/site-packages (from pyVim) (2.1.1)
Requirement already satisfied: pygments in /usr/local/lib/python3.7/site-packages (from pyVim) (2.5.2)
Requirement already satisfied: six in /usr/local/lib/python3.7/site-packages (from pyVim) (1.13.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/site-packages (from prompt-toolkit<3.1.0,>=2.0.0->pyVim) (0.1.7)

awscli tool installed by pip and showing in pip but when accessing - command not found

I just installed awscli using pip pip install awscli==1.15 --user. This was the output -
Requirement already satisfied: awscli==1.15 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (1.15.0)
Requirement already satisfied: colorama<=0.3.7,>=0.2.5 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (0.3.7)
Requirement already satisfied: docutils>=0.10 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (0.15.2)
Requirement already satisfied: rsa<=3.5.0,>=3.1.2 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (3.4.2)
Requirement already satisfied: PyYAML<=3.12,>=3.10 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (3.12)
Requirement already satisfied: botocore==1.10.0 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (1.10.0)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.12 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from awscli==1.15) (0.1.13)
Requirement already satisfied: pyasn1>=0.1.3 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from rsa<=3.5.0,>=3.1.2->awscli==1.15) (0.4.7)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from botocore==1.10.0->awscli==1.15) (0.9.4)
Requirement already satisfied: python-dateutil<2.7.0,>=2.1 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from botocore==1.10.0->awscli==1.15) (2.6.1)
Requirement already satisfied: futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from s3transfer<0.2.0,>=0.1.12->awscli==1.15) (3.3.0)
Requirement already satisfied: six>=1.5 in /Users/xyz/Library/Python/2.7/lib/python/site-packages (from python-dateutil<2.7.0,>=2.1->botocore==1.10.0->awscli==1.15) (1.12.0)
And it is also showing in the list of pip packages.
Package Version
-------------------------------------- --------
altgraph 0.10.2
ansible 2.8.0
asn1crypto 0.24.0
awscli 1.15.0
But when I'm trying to run any aws command I get command not found for example -
wwww:~ rgsd$ aws
-bash: aws: command not found
wwww:~ rgsd$ awscli
-bash: awscli: command not found
wwww:~ rgsd $ aws s3
-bash: aws: command not found
I also executed the command to include this in my $PATH.
export PATH=~/.local/bin:$PATH
But no success on that. I use Mac machine.
What am I doing wrong ?
For Modern macos/OSX, you need to find your ~/Library/Python/$version/bin directory and add it to your $PATH. This will help you locate the one where aws got installed.
$ ls -d ~/Library/Python/*/bin/aws
/Users/bbronosky/Library/Python/3.6/bin/aws
So based on that I added this line to my .bashrc
export PATH=$HOME/Library/Python/3.6/bin:$PATH
This link is helpful -
https://www.edureka.co/community/6039/post-installation-aws-cli-not-added

pip install fail: Terminal lists most recent attempts of package installation, won't install packages

In an attempt to access and run Matlab code via Jupyter notebook and Python, I tried installing 'matlab_kernal' (w/ typo) and 'matlab_kernel' as suggested by a blog, I didn't realize I needed MatLab, not MatLab Compiler Runtime.
I received the error:
"Collecting matlab_kernal
Could not find a version that satisfies the requirement matlab_kernal (from versions: )
No matching distribution found for matlab_kernal"
As a work around, I found python code on GitHub that calculated the metric I wanted, but the author said I'd need to install 'MPI' from 'mpi4py'.
However, it seems my Terminal is now stuck on my previous installation attempts of 'matlab_kernal'. It lists my previous attempts to install these packages (see all white text above red error message in the attached screen capture).
I'm running: pip 18.1 from /anaconda3/lib/python3.7/site-packages/pip (python 3.7)
I've tried:
pip uninstall 'package'
Terminal restart
laptop restart
Screenshot of Terminal error
Please use:
pip install matlab-kernel
Try with conda as well:
conda install -c pchrapka matlab_kernel
I think you're making a typo with kernal.
I am on py3.7 with pip v19.3.
Output:
$ pip install matlab-kernel
Collecting matlab-kernel
Downloading https://files.pythonhosted.org/packages/64/ad/5f471160ec33e2f0f3586d285cd5e3b6dff51027849f28369d43d1d57fd1/matlab_kernel-0.16.7-py3-none-any.whl
Requirement already satisfied: jupyter-client>=4.4.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from matlab-kernel) (5.3.4)
Collecting metakernel>=0.23.0
Downloading https://files.pythonhosted.org/packages/ad/a9/0cd74cfbc9c4aeb117bdb7fd9ff12c3890be34ef5c77932e00ef4afaca98/metakernel-0.24.3-py2.py3-none-any.whl (208kB)
|████████████████████████████████| 215kB 246kB/s
Collecting wurlitzer>=1.0.2; platform_system != "Windows"
Downloading https://files.pythonhosted.org/packages/24/5e/f3bd8443bfdf96d2f5d10097d301076a9eb55637b7864e52d2d1a4d8c72a/wurlitzer-2.0.0-py2.py3-none-any.whl
Requirement already satisfied: ipython>=4.0.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from matlab-kernel) (7.8.0)
Requirement already satisfied: pyzmq>=13 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (18.1.0)
Requirement already satisfied: tornado>=4.1 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (6.0.3)
Requirement already satisfied: traitlets in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (4.3.3)
Requirement already satisfied: python-dateutil>=2.1 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (2.8.0)
Requirement already satisfied: jupyter-core>=4.6.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jupyter-client>=4.4.0->matlab-kernel) (4.6.0)
Requirement already satisfied: pexpect>=4.2 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from metakernel>=0.23.0->matlab-kernel) (4.7.0)
Collecting portalocker
Downloading https://files.pythonhosted.org/packages/91/db/7bc703c0760df726839e0699b7f78a4d8217fdc9c7fcb1b51b39c5a22a4e/portalocker-1.5.2-py2.py3-none-any.whl
Requirement already satisfied: ipykernel in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from metakernel>=0.23.0->matlab-kernel) (5.1.2)
Collecting ipyparallel
Downloading https://files.pythonhosted.org/packages/3f/82/aaa7a357845a98d4028f27c799f0d3bb2fe55fc1247c73dc712b4ae2344c/ipyparallel-6.2.4-py2.py3-none-any.whl (198kB)
|████████████████████████████████| 204kB 698kB/s
Requirement already satisfied: decorator in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (4.4.0)
Requirement already satisfied: setuptools>=18.5 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (39.0.1)
Requirement already satisfied: pickleshare in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.7.5)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (2.0.10)
Requirement already satisfied: jedi>=0.10 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.15.1)
Requirement already satisfied: pygments in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (2.4.2)
Requirement already satisfied: appnope; sys_platform == "darwin" in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.1.0)
Requirement already satisfied: backcall in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from ipython>=4.0.0->matlab-kernel) (0.1.0)
Requirement already satisfied: ipython-genutils in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from traitlets->jupyter-client>=4.4.0->matlab-kernel) (0.2.0)
Requirement already satisfied: six in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from traitlets->jupyter-client>=4.4.0->matlab-kernel) (1.12.0)
Requirement already satisfied: ptyprocess>=0.5 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from pexpect>=4.2->metakernel>=0.23.0->matlab-kernel) (0.6.0)
Requirement already satisfied: wcwidth in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from prompt-toolkit<2.1.0,>=2.0.0->ipython>=4.0.0->matlab-kernel) (0.1.7)
Requirement already satisfied: parso>=0.5.0 in /Users/siddheshpisal/.pyenv/versions/3.6.7/envs/ori_venv/lib/python3.6/site-packages (from jedi>=0.10->ipython>=4.0.0->matlab-kernel) (0.5.1)
Installing collected packages: portalocker, ipyparallel, metakernel, wurlitzer, matlab-kernel
Successfully installed ipyparallel-6.2.4 matlab-kernel-0.16.7 metakernel-0.24.3 portalocker-1.5.2 wurlitzer-2.0.0
WARNING: You are using pip version 19.3; however, version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
It's a version issue for pip and MacOS
See this thread
terminal error in MacOS from command 'pip install 'package-name':
"Collecting 'package-name'
Could not find a version that satisfies the requirement 'package-name' (from versions: )
No matching distribution found for 'package-name'"
Uninstall pip and reinstall pip in terminal

spacy showing import module error while it is already installed

spacy is installed in vir env in python console
Building wheels for collected packages: en-core-web-sm Building
wheel for en-core-web-sm (setup.py) ... done Created wheel for
en-core-web-sm: filename=en_core_web_sm-2.1.0-cp36-none-any.whl
size=11074439
sha256=f67b5d1a325b5d49f50c2a0765610c51d01ff2644e78fa8568fc141506dac87c
Stored in directory:
C:\Users\DUDE\AppData\Local\Temp\pip-ephem-wheel-cache-02mgn7_m\wheels\39\ea\3b\507f7df78be8631a7a3d7090962194cf55bc1158572c0be77f
Successfully built en-core-web-sm Installing collected packages:
en-core-web-sm Successfully installed en-core-web-sm-2.1.0 ✔ Download
and installation successful You can now load the model via
spacy.load('en_core_web_sm') You do not have sufficient privilege to
perform this operation. ✘ Couldn't link model to 'en' Creating a
symlink in spacy/data failed. Make sure you have the required
permissions and try re-running the command as admin, or use a
virtualenv. You can still import the model as a module and call its
load() method, or create the symlink manually.
E:\anaconda\envs\textmining\lib\site-packages\en_core_web_sm -->
E:\anaconda\envs\textmining\lib\site-packages\spacy\data\en ⚠ Download
successful but linking failed Creating a shortcut link for 'en' didn't
work (maybe you don't have admin permissions?), but you can still load
the model via its full package name: nlp =
spacy.load('en_core_web_sm')
Tried this in jupyter notebook
!pip install spacy
Requirement already satisfied: spacy in
e:\anaconda\envs\textmining\lib\site-packages (2.1.8) Requirement
already satisfied: blis<0.3.0,>=0.2.2 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.2.4)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (2.22.0)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (1.0.2)
Requirement already satisfied: wasabi<1.1.0,>=0.2.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.2.2)
Requirement already satisfied: srsly<1.1.0,>=0.0.6 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.1.0)
Requirement already satisfied: numpy>=1.15.0 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (1.17.1)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (0.9.6)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (2.0.2)
Requirement already satisfied: preshed<2.1.0,>=2.0.1 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (2.0.1)
Requirement already satisfied: thinc<7.1.0,>=7.0.8 in
e:\anaconda\envs\textmining\lib\site-packages (from spacy) (7.0.8)
Requirement already satisfied: certifi>=2017.4.17 in
e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (2019.6.16) Requirement already
satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in
e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (1.25.3) Requirement already
satisfied: chardet<3.1.0,>=3.0.2 in
e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (3.0.4) Requirement already satisfied:
idna<2.9,>=2.5 in e:\anaconda\envs\textmining\lib\site-packages (from
requests<3.0.0,>=2.13.0->spacy) (2.8) Requirement already satisfied:
tqdm<5.0.0,>=4.10.0 in e:\anaconda\envs\textmining\lib\site-packages
(from thinc<7.1.0,>=7.0.8->spacy) (4.35.0)
import spacy
tok=spacy.load("en")
doc=tok(test_sentence)
[x.text for x in doc]
Getting error ModuleNotFoundError Traceback
(most recent call last) in
----> 1 import spacy
2 tok=spacy.load("en")
3
4 doc=tok(test_sentence)
5 [x.text for x in doc]
ModuleNotFoundError: No module named 'spacy'
I was able to run the spacy in python console, so I assumed the problem was with jupyter notebook. I followed https://anbasile.github.io/programming/2017/06/25/jupyter-venv/
what i did is, I added pip install ipykernel
then
ipython kernel install --user --name=projectname
At this point, you can start jupyter, create a new notebook and select the kernel that lives inside your environment.
I use windows, but its same for other OS. You should check your administrative rights and privilege. For Windows visit the User Account > Change User Account Control Settings > Pull down the bar to never notify. Try re running the install prompt. Should be fine.

Categories