I just installed the Liblas with pip:
C:\Users\Geri>pip install liblas
Requirement already satisfied (use --upgrade to upgrade): liblas in c:\python27\arcgis10.2\lib\site-packages
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\python27\arcgis10.2\lib\site-packages (from liblas)
when I want to import the module, I got the following:
>>> import liblas
Runtime error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python27\ArcGIS10.2\lib\site-packages\liblas\__init__.py", line 2, in <module>
from core import get_version
File "C:\Python27\ArcGIS10.2\lib\site-packages\liblas\core.py", line 136, in <module>
las = ctypes.CDLL(lib_name)
File "C:\Python27\ArcGIS10.2\Lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Please help
My solution was to ensure that liblas.dll and liblas_c.dll were in the DLLs folder in all my python instances (I have python 2.7 in ArcGIS, OSGeo4W and WinPython).
I found the dll's in C:\Python27\ArcGIS10.2\DLLs after trying every method I could find for installing the liblas package (WinPython control panel, pip and installing using the exe from https://pypi.python.org/pypi/libLAS/1.6.0).
I have not tried using liblas via OSGeo4w as I am not sure where to put the dlls (I put them in the C:/OSgeo4w64/bin folder but that did not help) and OSgeo4w command_line package list in the installer tells me that liblas is not available. I also ensured that C:/OSgeo4w64/bin is in my path (as that was a suggestion above and elsewhere)... not sure if that helped.
All working fine now.
Related
I am trying to install distribute module one my mac. I tried pip install distribute and got the error
***"""***
Collecting distribute
Using cached distribute-0.7.3.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/__init__.py", line 2, in <module>
from setuptools.extension import Extension, Library
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/extension.py", line 5, in <module>
from setuptools.dist import _get_unpatched
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/dist.py", line 7, in <module>
from setuptools.command.install import install
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/command/__init__.py", line 8, in <module>
from setuptools.command import install_scripts
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/setuptools/command/install_scripts.py", line 3, in <module>
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "/private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/pkg_resources.py", line 1518, in <module>
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/hj/gz4x7_lj5r9_shsmq40r2y180000gn/T/pip-build-10mpi66y/distribute/
***"""***
I tried the program "distribute_setup.py" and by running "python3.6 install_distribute.py" but got the error "urllib.error.HTTPError: HTTP Error 403: SSL is required"
I tried updating urllib but it said it was correct. any recommendations?
The 'Distribute' module is deprecated. Its development is now part of 'Setuptools'. So, if you install 'Setuptools' you should get 'Distribute'. See:
https://pypi.python.org/pypi/distribute/0.7.3
https://pypi.python.org/pypi/distribute/0.6.49
The first link to PyPI even says that 'Distribute':
This package is a simple compatibility layer that installs Setuptools 0.7+.
So, you might have better luck by trying to install or update 'Setuptools'. To get more into it, I think there is a problem with either:
Your pip version
Your Python version
Or, your 'Setuptools'
This is the line that I am interested in:
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
This error seems like something is trying to use a newly added feature that doesn't exist in the old version of a file. So, you probably need to update pip or 'Setuptools'.
Try:
using pip3: module "importlib._bootstrap" has no attribute "SourceFileLoader"
Specifically, see this answer: https://stackoverflow.com/a/47278208/9347694
Also try,
sudo pip install setuptools --upgrade error
Seems like others experienced this issue after installing Python 3.6. Are you sure you are using pip3? Is pip updated? Do you have 'Seyuptools' installed properly?
I had some problems with upgrading matplotlib recently so I ended up installing different versions of Python on my Mac (Sierra) via brew, and then uninstalled afterwards. However, now matplotlib works (2.0.2) but whenever I run a particular python script that used to work I get an error which I didn't have before:
Traceback (most recent call last):
File "sim.py", line 254, in <module>
main()
File "sim.py", line 118, in main
db = shelve.open('.sim_balance', 'c')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shelve.py", line 243, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shelve.py", line 227, in __init__
Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/anydbm.py", line 84, in open
mod = __import__(result)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/dbhash.py", line 7, in <module>
import bsddb
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bsddb/__init__.py", line 67, in <module>
import _bsddb
ImportError: No module named _bsddb
According to my searches online this has something to do with my brew installed python interfering? I also deleted all my files in /Library/Python/2.7/site-packages yesterday which may have caused this as well.
I have tried homebrew brew install berkeley-db but then pip install bsddb3 yields:
Terrys-MBP:site-packages Terry$ pip install bsddb3
Collecting bsddb3
Using cached bsddb3-6.2.4.tar.gz
Complete output from command python setup.py egg_info:
Can't find a local Berkeley DB installation.
(suggestion: try the --berkeley-db=/path/to/bsddb option)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/m5/1fg5rnj11_9cz5pntlqlwzyc0000gn/T/pip-build-elBAFK/bsddb3/
EDIT: Solved. Installed anaconda, installed bsddb via conda install and everything is working now.
Solved. I Installed anaconda, installed bsddb via conda install and everything is working now.
Can't seem to get the Python3 bindings for VLC functioning.
I'm doing pip3 install python_vlc which results in:
Collecting python-vlc
Installing collected packages: python-vlc
Successfully installed python-vlc-1.1.2
So, when I do import vlc it gives me the following error:
>>> import vlc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/vlc.py", line 173, in <module>
dll, plugin_path = find_lib()
File "/usr/local/lib/python3.5/site-packages/vlc.py", line 165, in find_lib
dll = ctypes.CDLL('libvlc.dylib')
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ctypes/__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libvlc.dylib, 6): image not found
I tried looking for a solution online, but can't seem to find the cause.
Alright, so I found the problem...
I tried uninstalling python-vlc via pip3 uninstall python-vlc and uninstall the VLC app with AppZapper to completely remove everything. After this I reinstalled it, it worked so I can do import vlc in commandline now.
Update: so after I did that I ran into another issue. I got this error: core libvlc error: No plugins found! Check your VLC installation.
Added the following line to my .bash_profile:
export VLC_PLUGIN_PATH=$VLC_PLUGIN_PATH:/Applications/VLC.app/Contents/MacOS/plugins
which fixed it.
I've installed pymorphy2 using pip:
Requirement already satisfied (use --upgrade to upgrade): pymorphy2 in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): docopt>=0.6 in /usr/local/lib/python2.7/site-packages (from pymorphy2)
Requirement already satisfied (use --upgrade to upgrade): pymorphy2-dicts<3.0,>=2.4 in /usr/local/lib/python2.7/site-packages (from pymorphy2)
But when I'm trying to import this library in Python interactive shell I get this:
>>> import pymorphy2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/pymorphy2/__init__.py", line 3, in <module>
from .analyzer import MorphAnalyzer
File "/usr/local/lib/python2.7/site-packages/pymorphy2/analyzer.py", line 10, in <module>
from pymorphy2 import opencorpora_dict
File "/usr/local/lib/python2.7/site-packages/pymorphy2/opencorpora_dict/__init__.py", line 4, in <module>
from .storage import load_dict as load
File "/usr/local/lib/python2.7/site-packages/pymorphy2/opencorpora_dict/storage.py", line 24, in <module>
from pymorphy2.utils import json_write, json_read
File "/usr/local/lib/python2.7/site-packages/pymorphy2/utils.py", line 5, in <module>
import bz2
ImportError: No module named bz2
Ok, no problem:
sudo apt-get install libbz2-dev
And finally:
maestro#UIServer:~$ sudo apt-get install libbz2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libbz2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up python-pip (0.3.1-1ubuntu2) ...
Traceback (most recent call last):
File "/usr/bin/pycentral", line 2196, in <module>
main()
File "/usr/bin/pycentral", line 2190, in main
rv = action.run(global_options)
File "/usr/bin/pycentral", line 1478, in run
runtimes = get_installed_runtimes()
File "/usr/bin/pycentral", line 279, in get_installed_runtimes
default_version = pyversions.default_version(version_only=True)
File "/usr/share/pycentral-data/pyversions.py", line 172, in default_version
raise ValueError, "/usr/bin/python does not match the python default version. It must be reset to point to %s" % debian_default
ValueError: /usr/bin/python does not match the python default version. It must be reset to point to python2.6
dpkg: error processing python-pip (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
How to resolve this conflict with versions of python in my case?
Looks like you need to create a new symbolic link for python 2.6.
ln -sf /usr/bin/python2.6 /usr/bin/python
I am trying to install django-tracker and have extracted it in a directory and now when am running python setup.py i am getting the followig error
vikas#vikas-laptop:~/djcode/django-tracking-0.4.1$ python setup.py
Traceback (most recent call last):
File "setup.py", line 6, in <module>
import tracking
File "/home/vikas/djcode/django-tracking-0.4.1/tracking/__init__.py", line 1, in <module>
import listeners
File "/home/vikas/djcode/django-tracking-0.4.1/tracking/listeners.py", line 6, in <module>
from django.core.cache import cache
File "/usr/local/lib/python2.7/dist-packages/django/core/cache/__init__.py", line 70, in <module>
if DEFAULT_CACHE_ALIAS not in settings.CACHES:
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
Can anyone please help me out in solving this problem?
Try following alternate method:
pip install git+https://github.com/bashu/django-tracking.git
This works for me. Following is trace of the same:
root#3239fee56ba9:/home/docker/code/gstudio/gnowsys-ndf# pip install git+https://github.com/bashu/django-tracking.git
Collecting git+https://github.com/bashu/django-tracking.git
Cloning https://github.com/bashu/django-tracking.git to /tmp/pip-IMNBJq-build
Requirement already satisfied (use --upgrade to upgrade): django>=1.4 in /usr/local/lib/python2.7/dist-packages (from django-tracking==0.4.1)
Installing collected packages: django-tracking
Running setup.py install for django-tracking ... done
Successfully installed django-tracking-0.4.1
django-tracking needs some fixes to work with Django 1.5 and 1.6.
I've created a fork here https://github.com/pcraston/django-tracking
(fixes for Django 1.5 were copied from https://bitbucket.org/romanalexander/django-tracking)
You should give python setup.py a specific command. If you wish to install it, then do the following:
$ python setup.py install
if you wish to work on the package to enhance it, then do the following:
$ python setup.py develop
Of course, it goes without saying that this should occur within virtualenv and if you are installing the package you can do so via pip.