Python Pandas.tests.extension Module Not Found - python

I'm quite new to python and have been trying to run code for someone's project. However, it kept giving me the ModuleNotFound error message that says - "No module name 'pandas.tests.extension.numpy_' " in the ubuntu terminal.
Inside the code itself, the import statement is
from pandas.tests.extension.numpy_.test_numpy_nested import np
I do have the pandas module installed. Do you guys know what the issue could be and how to fix this? Thank you
Terminal and import line screenshot

Use two import lines
import pandas.tests.extension
import numpy_.test_numpy_nested as np

Related

Why can't python find the Module inside my computer

from sys import path
path.append("/Users/paulb/Downloads/twsapi_macunix/IBJts/source/pythonclient/ibapi")
from ibapi.client import EClient
Getting the error
ModuleNotFoundError: No module named 'ibapi'
I have used this style of path.append() on a different computer and it has worked, but I can't get it running on the Mac. Anyone have any suggestions on what I am doing wrong / a different way to get python looking in the folder that I want it to? Thanks

Import error: cannot import name 'unicode_emo' from 'emot.emo_unicode'

I am trying to use emojis and used the code below but it keeps giving import error. I am using Jupyter notebook and have updated the anaconda. I also installed emot on conda cmd using
pip install emot still it shows the same import error.
import re
from emot.emo_unicode import UNICODE_EMO,EMOTICONS
It seems that imports with Jupyter Notebook cause a lot of troubles to people because Jupyter does use the same python environment as your console.
Follow this link to see ways of successfully import modules.
I just checked the source file of emot.emo_unicode, and it seems like it only defines the following variables:
EMOTICONS_EMO
EMOJI_UNICODE
EMOJI_ALIAS_UNICODE
UNICODE_EMOJI
UNICODE_EMOJI_ALIAS
These do not match the variables that you're importing, as neither UNICODE_EMO nor EMOTICONS is defined by this module. To fix this, you'll need to import the correct variables.
The issue gets resolved if you try the below:
from emot.emo_unicode import UNICODE_EMOJI # For emojis
from emot.emo_unicode import EMOTICONS_EMO # For EMOTICONS
for me it got resolved with
from emoji import EMOJI_DATA
earlier I was using UNICODE_EMO / ENICODE_EMOJI

Import modules created locally

I am trying to learn how to import modules in python that are created locally. Below is a module that I created and saved in the python folder on my local disk.
When I try to call this module in another piece of code, I get an error-
I am using Jupyter notebook and both the module and code calling the module are in the same directory.
Can someone advise what I am doing wrong here?
can you try this?
import sys
sys.path.append('C:/Users/hchopra/Desktop/Python-Folder')
import myModule as m
m.fish()

How do I get a particular python module to work in Anaconda?

I don't have a lot of programming experience, so please try to keep answers relatively noob-friendly! :) Basically, I have a Python...library, I guess? or module? that I need to run in Spyder through Anaconda. This seems to be a very obscure module called PySPM, used for analyzing scanning probe microscopy data, that I received from a colleague my lab collaborates with. When I try to run a piece of software which uses this module, it gives this error:
ImportError: No module named 'PySPM.io'
The code itself which triggers this reads as follows:
from os import path
from PySPM.io.Translators.Utils import uiGetFile
from PySPM.io.Translators.BEPSndfTranslator import BEPSndfTranslator
from PySPM.io.Translators.BEodfTranslator import BEodfTranslator
from PySPM.analysis.BESHOFitter import BESHOFitter
The first line that says from PySPM.io.Translators.Utils import uiGetFile is what's triggering the error. I'm really stuck scratching my head here. What's going on and how can I solve it?
Pycroscopy is the (thoroughly) reorganized version of PySPM.
#Martensite try:
$ pip install pycroscopy

Importing issues with Python Modules

I was having issues getting the scikit-learn module to import into python. It would import into the python shell, but not when I did it through my IDE. After reading lots of things online, I got it to work by using:
import sys
sys.path.append(r"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages")
import sklearn
Does anyone have a suggestion so that I don't need to do the sys thing every time I want to use the module?
In your IDE, find where you can change the "Python interpreter" setting, and point it to /Library/Frameworks/Python.framework/Versions/2.7/bin/python

Categories