ImportError: pyproj._datadir does not export expected C variable PYPROJ_GLOBAL_CONTEXT - export

I am getting this error when trying to import geopandas package in jupyter and using python. I am able to import pandas,numpy and seaborn without problems but for some reason geopandas and keplergl do not work
ImportError: pyproj._datadir does not export expected C variable PYPROJ_GLOBAL_CONTEXT
I tried googling this but cant find anything

Related

Attempted import error: 'MapControl' is not exported from 'react-leaflet'

I tried using react-leaflet-draw and I keep on getting this error:
./node_modules/react-leaflet-draw/dist/esm/EditControl.js
Attempted import error: 'MapControl' is not exported from 'react-leaflet'.
I just used the examples here: https://www.npmjs.com/package/react-leaflet-draw
it is because MapControl is not part of react-leaflet lib anymore (https://react-leaflet-v2-docs.netlify.app/docs/en/components). Could you figure out its new name? Interested here!

Importing packages errors

Error in importing "from watson_developer_cloud import ToneAnalyzerV3", and "ibm_watson" in Visual Studio Code.
Python using VS code to run the Tone Analyzer in IBM Watson cloud. I tried the existing code, however some errors occur while compiling the code, as import packaging error happen. Even the tensorflow already updated and the specific packages already installed.
The bold fonts are the errors.
from __future__ import print_function
import json
from os.path import join, dirname
**from ibm_watson import ToneAnalyzerV3
from ibm_watson.tone_analyzer_v3 import ToneInput**
import operator
import twitter
import os
import json
**from watson_developer_cloud import ToneAnalyzerV3**
from _codecs import encode
I expect there is no wrong once compiled.

Uncaught TypeError: (0 , o.default) is not a function: What's causing it?

In my create react app project I'm running into the following error in my production build (not in my dev build):
Uncaught TypeError: (0 , o.default) is not a function
at Object.e.f.(:4444/anonymous function)...
I've been investigating this bug for a couple of hours but struggle to find out how to debug this uglified piece of js.
What makes it tough is that the error returns o.default and not SomeLibrary.default so I don't really know where to start my search really...
What does that o.default mean in this case? Any tips for figuring out what's going wrong here?
It seems to be import statement somewhere in your file is incorrect.
Example: (from an issue)
// fails
import combineReducers from "redux"
// correct
import { combineReducers } from "redux"
What makes it tough is that the error returns o.default and not SomeLibrary.default so I don't really know where to start my search really...
There's nothing but exported in some library just as o. Example default export:
export default {
o: something
}
For those who tried the solution above and still cannot solve this problem, you might be importing the library successfully and then using the library in a function that is located in the same file.
But, if you export that file and import it to another file, that is where you might be having a problem.
Simply import your already exported file as -
import {myComponent} from "/util/http"
instead of -
import myComponent from "/util/http"
Hope that helps.
If this is happening for anyone with Auth.signIn using aws-amplify, please try the below update for aws-amplify. This worked as a permanent fix and didn't break any of my current code.
sudo npx npm-check-updates -i '/#?aws-amplify/' && npm update --force
Just in case it helps someone, in my case I was using React component inside a JS file which caused this error.

Error importing C functions in python

I'm using eclipse with PyDev, Python 2.7, and have the following problem.
From a package, containing .py and c modules, i have imported the .py modules, but not the C source files.
I have imported the C Function module (.py!) from the sg package, which includes the following line:
try:
import sg._cfunc as _cfunc
except ImportError:
import pyximport
pyximport.install(setup_args={"include_dirs": np.get_include()},
reload_support=True)
import sg._cfunc as _cfunc
ImportError: No module named _cfunc
However the C Source file is in .../site-packages/sg.
Moreover, this function was working beforehand, and is still working on an other computer.
I have already reinstalled Cython, but nothing happened.
Any idea? :(

pycrypto develoment server error "from Crypto.Cipher import blockalgo"

I have installed pycrypto version 2.6 , and i am getting this error
from Crypto.Cipher import blockalgo
ImportError: cannot import name blockalgo
I have read many post but i am unable to solve this problem
If you are not able to import anything from Crypto.Cipher at all, it might be due to folders, crypto and respective egg info, under site-packages are created with lower-case 'c'
/Library/Python/2.7/site-packages/crypto
/Library/Python/2.7/site-packages/crypto-1.0.0-py2.7.egg-info
Imports were successful when same case was used while importing
from crypto.Cipher import AES
or renaming the folders
/Library/Python/2.7/site-packages/Crypto-1.0.0-py2.7.egg-info
/Library/Python/2.7/site-packages/Crypto
I went with the later, to have consistency with others.
I use Eclipse and was able to overcome this problem using one of the above solutions.
Sometimes we overlook these kind of details easily. Its a long shot, hope this helps!

Resources