I'm the owner of this repo and I'm trying to import it from another project. I installed it using pip via pip install git+https://github.com/FranGoitia/shapelets, but I'm not able to import it. I tried importing shapelets and shapelets_classifier and neither worked.
you don't install the git repo the right way.
try this:
pip install -e git+git://github.com/FranGoitia/shapelets#master#egg=shapelets_classifier-1.0-py3.5
then you can use
import shapelet
As you can see in the repository, the file you're actually trying to import from is shapelet.py, so try import shapelet
Related
I am trying to use the Scratch library.
For example:
from scratch.probability import normal_cdf
from scratch.linear_algebra import Vector, dot
#...
I installed Scratch using pip install scratch but I receive this error: ModuleNotFoundError: No module named 'scratch'.
Can you help me?
pip install scratch will install this: https://pypi.org/project/scratch/
But I guess that what you want to use is that: https://github.com/joelgrus/data-science-from-scratch
The second one is not meant to be installed through pip but used directly in a clone of the project as documented in its README.
About pip install scratch-probability (https://pypi.org/project/scratch-probability/#description), as it's not documented, you need to go check the content of the tarball to know how the package inside are named (if they are what's expected).
I'm trying to use pyscenedetect library on python for videos but I get this error when using the python interface and when I use the command line interface I get the error "ModuleNotFoundError: No module named 'cv2'"
even though I believe I installed both correctly according to the documentations.
I have trying to look for different ways to import opencv for the second error but to no avail. As for the first error i can't find any answers to my problem.
import cv2
import numpy as numpy
import os
import scenedetect
from scenedetect.video_manager import VideoManager
from scenedetect.scene_manager import SceneManager
from scenedetect.frame_timecode import FrameTimecode
from scenedetect.stats_manager import StatsManager
from scenedetect.detectors import ContentDetector
If you have pip you can try
pip install opencv-python
If you have anaconoda, you can try
conda install -c conda-forge opencv
it's probable that you installed it on a different python installation in your PC.
To know where your python installation is you can launch python and:
import sys
sys.path
To get the list of everything you have installed you can:
pip freeze > installed_modules.txt
Try only running
import cv2
So that you can test it
I found the problem. As Ivan was pointing out, the problem was with openCV.
I used the following command:
sudo apt install python3-opencv
I downloaded multiple modules (Discord API, cx_Freeze) (pip download, Windows 10) and now I wanted to use them.
But when I want to import them, it says there isn’t any module.
From my former Python using (before resetting computer) I‘ve added a pycache folder and it worked for one module. I‘m not able to reproduce it for other modules. What to do?
I‘ve only one Python version (3.6.5) on PC.
I‘ve checked the \site-packages folder and they‘re there.
If you are using python3 then try downloading the library using
pip3 install libname
but if you are using python2 then install the library using
pip2 install libname or just pip install libname
try with these command and reply
try installing your library using the command prompt in normal user and with the admin user so that you will get to know that what is happening and also if it is still not working then try installing the library into the same folder of your project using pip custom install command
pip install -t <direct directory> <package>
then use the import statement
For Example I used
pip2 install -t c:\Users\Nav\Desktop\projectss cx_freeze
then i imported the library using
#from cx_Freeze import setup, Executable
import cx_Freeze
from cx_Freeze import *
it worked.
Previously i was getting error like :
File "C:\Python27\lib\site-packages\cx_Freeze\__init__.py", line 10, in <module>
from cx_Freeze.finder import *
ImportError: No module named finder
After custom install it is working
I had this line in my code from faker import Factoryand I had the error ImportError: no module named faker. So I looked up on Stack Overflow and pip installed fake-factory. It says installation successful but then when I ran the code again it gives me another import error:
ImportError: The ``fake-factory`` package is now called ``Faker``.
Please update your requirements.
What am I missing here?
I had the same problem.
As the ImportError implies, you need to install Faker for this.
Move the directory in which your python library is installed and try this..
First uninstall fake-factory (I use pip) pip uninstall fake-factory
Then check if it is uninstalled using pip freeze and it should not be there
Then, proceed with installing Faker by pip install Faker
Now, try running that code again, it should work. Hope this helps :)
For me, It was working when I run pip uninstall fake-factory.
I'm trying to install tlslite. After installed the module I've tried to test it and I receive this error:
from .checker import Checker
ImportError: No module named checker
I've checked on my pip module list and checker is installed...
Any idea?
Thanks!
Assuming you installed tlslite correctly, try this:
>>> from tlslite.checker import Checker
If that doesn't work, check that tlslite is in your site packages
To work with tlslite I recommend to use a virtualenv and install TlsLite inside:
cd ~/virtualenv/ # <- all my virtualenv are here
virtualenv myvenv
source ~/virtualenv/myvenv/bin/activate
pip install -q -U pip setuptools # ensure last version
pip install tlslite
With that in hand, you can use the Checker:
$ python
>>> from tlslite.checker import Checker
>>>
Et voilà !