python-import

Error importing Polygon from shapely.geometry.polygon

爷,独闯天下 提交于 2020-01-13 18:40:33
问题 In my Anaconda 2.2 64bit with Python 3.4.3 the following line works well: import shapely But the following line: from shapely.geometry.polygon import Polygon returns the following error: OSError: [WinError 126] The specified module could not be found What am I missing? EDIT I tried with iNotebook, idle.exe and Eclipse. They all use Anaconda (the only Python installation on my computer) and they all show the same error. If I type from shapely.geometry import Polygon in Eclipse, then I click on

Openslide-python import error

安稳与你 提交于 2020-01-13 17:10:13
问题 I receive the following error when running import openslide from inside python terminal <code>Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\dev_res\python\python2_713\lib\site-packages\openslide\__init__.py", line 29, in <module> from openslide import lowlevel File "C:\dev_res\python\python2_713\lib\site-packages\openslide\lowlevel.py", line 41, in <module> _lib = cdll.LoadLibrary('libopenslide-0.dll') File "C:\dev_res\python\python2_713\lib\ctypes\__init__

Error importing built-in module “_subprocess” using Google Cloud Platform's Local Development Server

别来无恙 提交于 2020-01-13 16:27:08
问题 Does anyone know how I can fix the following error? Error Message: "Import Error C:\Users\MicroSilicon\Desktop\hello_world>python2 "C:\Users\MicroSilicon\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py" app.yaml INFO 2019-12-16 09:23:23,341 devappserver2.py:285] Skipping SDK update check. INFO 2019-12-16 09:23:23,506 api_server.py:282] Starting API server at: http://localhost:60054 INFO 2019-12-16 09:23:23,509 dispatcher.py:263] Starting module "default" running at: http:

Error importing built-in module “_subprocess” using Google Cloud Platform's Local Development Server

回眸只為那壹抹淺笑 提交于 2020-01-13 16:27:05
问题 Does anyone know how I can fix the following error? Error Message: "Import Error C:\Users\MicroSilicon\Desktop\hello_world>python2 "C:\Users\MicroSilicon\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\dev_appserver.py" app.yaml INFO 2019-12-16 09:23:23,341 devappserver2.py:285] Skipping SDK update check. INFO 2019-12-16 09:23:23,506 api_server.py:282] Starting API server at: http://localhost:60054 INFO 2019-12-16 09:23:23,509 dispatcher.py:263] Starting module "default" running at: http:

How can I avoid PROJ_LIB error in importing basemap?

偶尔善良 提交于 2020-01-13 11:09:14
问题 I tried to import basemap as follows in Python: from mpl_toolkits.basemap import Basemap and I get the following error: Traceback (most recent call last): File "<ipython-input-16-880204a64918>", line 2, in <module> from mpl_toolkits.basemap import Basemap File "C:\Users\bakhadher\AppData\Local\Continuum\anaconda3\lib\site-packages\mpl_toolkits\basemap\__init__.py", line 155, in <module> pyproj_datadir = os.environ['PROJ_LIB'] File "C:\Users\bakhadher\AppData\Local\Continuum\anaconda3\lib\os

How can I avoid PROJ_LIB error in importing basemap?

故事扮演 提交于 2020-01-13 11:09:08
问题 I tried to import basemap as follows in Python: from mpl_toolkits.basemap import Basemap and I get the following error: Traceback (most recent call last): File "<ipython-input-16-880204a64918>", line 2, in <module> from mpl_toolkits.basemap import Basemap File "C:\Users\bakhadher\AppData\Local\Continuum\anaconda3\lib\site-packages\mpl_toolkits\basemap\__init__.py", line 155, in <module> pyproj_datadir = os.environ['PROJ_LIB'] File "C:\Users\bakhadher\AppData\Local\Continuum\anaconda3\lib\os

C++ Python module import error: “undefined symbol: Py_InitModule3” ( Py_InitModule () )

陌路散爱 提交于 2020-01-13 08:16:35
问题 I am just starting an attempt to write my first Python extension module in C and are using instructions provided at https://www.tutorialspoint.com/python/python_further_extensions.htm I am on Linux Mint 18.1, using Python 3.6.1 in its virtualenv version. As first step I have compiled a very minimalistic version of the Python module I plan to write. Here my C-code: include <Python.h> static PyObject* uniqueCombinations(PyObject* self) { return Py_BuildValue("s", "uniqueCombinations() return

Python: importing a module that imports a module

自闭症网瘾萝莉.ら 提交于 2020-01-13 05:44:48
问题 So in a file foo I am importing modules: import lib.helper_functions import lib.config And in helper_functions.py, I have: import config When I run the main function of foo I get an ImportError EDIT: Here is the structure of the files I have foo.py lib/ config.py helper_functions.py The error results from importing config in helper_functions Traceback (most recent call last): File "C:\Python33\foo.py", line 1, in <module> import lib.helper_functions File "C:\Python33\lib\helper_functions.py",

import inside of a Python thread

十年热恋 提交于 2020-01-10 22:27:47
问题 I have some functions that interactively load python modules using __import__ I recently stumbled upon some article about an "import lock" in Python, that is, a lock specifically for imports (not just the GIL). But the article was old so maybe that's not true anymore. This makes me wonder about the practice of importing in a thread. Are import / __import__ thread safe? Can they create dead locks? Can they cause performance issues in a threaded application? EDIT 12 Sept 2012 Thanks for the

Import vendored dependencies in Python package without modifying sys.path or 3rd party packages

妖精的绣舞 提交于 2020-01-10 13:01:46
问题 Summary I am working on a series of add-ons for Anki, an open-source flashcard program. Anki add-ons are shipped as Python packages, with the basic folder structure looking as follows: anki_addons/ addon_name_1/ __init__.py addon_name_2/ __init__.py anki_addons is appended to sys.path by the base app, which then imports each add_on with import <addon_name> . The problem I have been trying to solve is to find a reliable way to ship packages and their dependencies with my add-ons while not