This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
Trying to install this ipython version. infact there's a django-starter project which uses buildout for his needs.. And that scripts tried to get ipython 0.11 with easy_install.I tried to grep everything out from this package but there's no ipython mentioned in any files at all. so I can't install newer version I need ipython0.11 to work. Please =)
roman# easy_install "ipython==0.11" > errors
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1712, in main
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 211, in run
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 446, in easy_install
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 476, in install_item
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 655, in install_eggs
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 930, in build_and_install
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 919, in run_setup
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 62, in run_setup
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 64, in <lambda>
File "setup.py", line 54, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/__init__.py", line 46, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/embed.py", line 32, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/interactiveshell.py", line 26, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/interactiveshell.py", line 36, in <module>
File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/history.py", line 20, in <module>
File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
register_adapters_and_converters()
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined
update:
importing sqlite3 from python console gives this error:
>>> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
register_adapters_and_converters()
File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined
Judging from your error message and our exchange in the comments, I think the big problem is you might just be missing sqlite3 support for python.
From your error messages I take it you're running FreeBSD, so you should install the databases/py-sqlite3 package from ports.
I don't know much about FreeBSD's ports system, but after you install the py-sqlite3 package, your problem should hopefully be cleared up.
I'm going to assume, from brief reading, you do something like this, assuming you have the ports tree on your system:
cd /usr/ports/databases/py-sqlite3
make && make install
Related
I'm new to both Python and ArcGIS Pro; I'm just getting started and I'm trying to install a couple of Python packages in order to read, modify, and write Feature Class files using a Spatially Enabled DataFrame (SEDF). To do that, I need to install a couple of packages first. I've created a virtual environment in PyCharm, and was able to install a few packages, however, now when I try to install or uninstall any new packages, I get this error:
Traceback (most recent call last):
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 89, in _tempfile
os.write(fd, reader())
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\importlib\abc.py", line 371, in read_bytes
with self.open('rb') as strm:
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\importlib\_adapters.py", line 54, in open
raise ValueError()
ValueError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\packaging_tool.py", line 114, in main
do_install(pkgs)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\packaging_tool.py", line 59, in do_install
run_pip(['install'] + pkgs)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\packaging_tool.py", line 73, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 209, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\cli\autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\cli\main_parser.py", line 8, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 23, in <module>
from pip._internal.cli.parser import ConfigOptionParser
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\cli\parser.py", line 12, in <module>
from pip._internal.configuration import Configuration, ConfigurationError
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\configuration.py", line 20, in <module>
from pip._internal.exceptions import (
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_internal\exceptions.py", line 13, in <module>
from pip._vendor.requests.models import Request, Response
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_vendor\requests\__init__.py", line 135, in <module>
from . import utils
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\pip\_vendor\requests\utils.py", line 27, in <module>
from . import certs
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\wrapt\importer.py", line 170, in exec_module
notify_module_loaded(module)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
return wrapped(*args, **kwargs)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
hook(module)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\certifi_win32\wrapt_pip.py", line 35, in apply_patches
import certifi
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\wrapt\importer.py", line 170, in exec_module
notify_module_loaded(module)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\wrapt\decorators.py", line 470, in _synchronized
return wrapped(*args, **kwargs)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\wrapt\importer.py", line 136, in notify_module_loaded
hook(module)
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\certifi_win32\wrapt_certifi.py", line 20, in apply_patches
certifi_win32.wincerts.CERTIFI_PEM = certifi.where()
File "C:\Users\alexis\Documents\Wardrobe\Testvenv1\lib\site-packages\certifi\core.py", line 37, in where
_CACERT_PATH = str(_CACERT_CTX.__enter__())
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\contextlib.py", line 135, in __enter__
return next(self.gen)
File "C:\Users\alexis\AppData\Local\Programs\Python\Python310\lib\importlib\_common.py", line 95, in _tempfile
os.remove(raw_path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\alexis\\AppData\\Local\\Temp\\tmp0nrmgsas'
So far I've tried:
~Giving PyCharm Administrator permissions
~Used pip in the terminal (I always get the same error message back regardless of how I try to install/uninstall packages)
~Tried downloading other packages (same error message)
~Restarting the computer/PyCharm
~Using ArcGIS Pro to create a cloned environment GDAL, Fiona, and other packages can be installed on. However Fiona never seems to install properly, so now I'm trying to use a virtual environment in PyCharm to run the packages necessary for a Spatially Enabled DataFrame
It seems like the computer is trying to say that somehow a file is open somewhere and must be closed before it can install/uninstall anything else. However, I'm not really sure how to do that, or what that file would even be.
Despite the ValueError and PermissionError, scripts still run just fine; I just can't install or uninstall anything.
In short, I have two problems at once: (1) the package Fiona never seems to install properly, and (2) now I'm stuck with a ValueError and PermissonError that keeps me from installing/uninstalling other packages.
I'm using Python 3.10.2, PyCharm 2021.3.3, and Windows 10, 64 bit.
I've been stuck on this problem for a while now. Any advice would be much appreciated!
I've had contact with the helpdesk of Esri and they recommended using conda instead of pip to install the package. That seems to have worked for me.
Since I also would like to get it working with just pip I was able to determine that the minimal install is an option although you need to install cachetools, lxml, and requests-oauthlib even though they aren't mentioned in the instructions. That allowed me to import arcgis so it seems to have worked. I haven't had a chance to take more time with it, but perhaps this solves it for you too.
Just as a reminder, in order to fix your installation of Python you'd need to reinstall Python, but remove the Lib folder in between the un- and re-installation. (Or delete and remake the virtual environment if you used that.)
I use Ubuntu 18.04. By mistake, I changed argparse.py file in usr/lib/python3.6. I couldn't fix it and I thought to remove it, so I could reinstall. Now I can't reinstall, whenever I try "pip install argparse" I get an error like this:
Defaulting to user installation because normal site-packages is not writeable
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 186, in _main status = self.run(options, args)
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/install.py", line 279, in run
session = self.get_default_session(options)
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/req_command.py", line 74, in get_default_session
self._session = self.enter_context(self._build_session(options))
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/req_command.py", line 91, in _build_session
index_urls=self._get_index_urls(options),
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/network/session.py", line 241, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/network/session.py", line 129, in user_agent from pip._vendor import distro
File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/distro.py", line 37, in <module>
import argparse ModuleNotFoundError: No module named 'argparse'
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module> sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/main.py", line 75, in main
return command.main(cmd_args)
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 105, in main return self._main(args)
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 224, in _main self.handle_pip_version_check(options)
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/req_command.py", line 146, in handle_pip_version_check timeout=min(5, options.timeout)
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/req_command.py", line 91, in _build_session index_urls=self._get_index_urls(options),
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/network/session.py", line 241, in __init__self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python3.6/dist-packages/pip/_internal/network/session.py", line 129, in user_agent
from pip._vendor import distro
File "/usr/local/lib/python3.6/dist-packages/pip/_vendor/distro.py", line 37, in <module>
import argparse
ModuleNotFoundError: No module named 'argparse'
Could you please help me to fix this?
argparse is part of the standard library, not a third-party module. The standard library is not managed via pip (that is both its blessing and its bane).
So you have to fix or reinstall python itself.
argparse is (since Python 3.2) part of the standard library. Just get the file from the official github (I'm assuming cpython, adapt the version as necessary by selecting the correct branch, the link is for python 3.8) and put it back where the one you deleted was
Sorry for asking stupid questions.
I have packaged my python source code using Pyintaller (with Ubuntu 16.04 and pyinstaller 3.3.1). It runs perfectly on my own computers but get different errors. The typical error I got is
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.[1996] Failed to execute script predict".
The detailed error message is shown below. Please help me with this, i don't know how to fix it now. Many thanks!
/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py:687: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
Using TensorFlow backend.
Traceback (most recent call last):
File "predict.py", line 2, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "data_pre.py", line 3, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "csvdata_pre.py", line 1, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/__init__.py", line 3, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/utils/__init__.py", line 6, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/utils/conv_utils.py", line 9, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/backend/__init__.py", line 84, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/tensorflow/__init__.py", line 24, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/tensorflow/python/__init__.py", line 115, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/tensorflow/python/platform/test.py", line 61, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/mock/__init__.py", line 2, in <module>
File "/tmp/pip-install-47BC1A/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 396, in load_module
File "site-packages/mock/mock.py", line 71, in <module>
File "site-packages/pbr/version.py", line 462, in semantic_version
File "site-packages/pbr/version.py", line 449, in _get_version_from_pkg_resources
File "site-packages/pbr/packaging.py", line 812, in get_version
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.
[49902] Failed to execute script predict
I'm trying to use py2app to create a standalone application of mac. When I`m using the alias mode everything work fine, but when I try to
python setup.py py2app
I receive this error:
Traceback (most recent call last):
File "setup.py", line 21, in <module>
setup_requires=['py2app'],
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/py2app/build_app.py", line 659, in run
self._run()
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/py2app/build_app.py", line 865, in _run
self.run_normal()
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/py2app/build_app.py", line 943, in run_normal
self.process_recipes(mf, filters, flatpackages, loader_files)
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/py2app/build_app.py", line 824, in process_recipes
rval = check(self, mf)
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/py2app/recipes/virtualenv.py", line 86, in check
mf._scan_code(co, m)
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/modulegraph/modulegraph.py", line 1543, in _scan_code
self._scan_bytecode(co, m)
File "/Users/robert/Envs/py36/lib/python3.6/site-packages/modulegraph/modulegraph.py", line 1570, in _scan_bytecode
n = len(code)
NameError: name 'code' is not defined
My version of Python 3.5, py2app 0.10, module graph 0.13. Has anyone encountered a similar one, and how I can solve it?
P.S. Sorry for my bad English.
I had the same issue.
This issue will be fixed in moudulegraph 0.14
If you can't wait you can pull from the repo any point after this commit:
https://bitbucket.org/ronaldoussoren/modulegraph/commits/32c6c60f9dcdb106219a1476218e0d364cb11255
I'm trying to deploy my python application using py2app.
I created the setup file using : py2applet --make-setup MyApplication.py
Then I did this to test it : python setup.py py2app -A
That worked as well. My GUI program runs.
When I try the last step: python setup.py py2app
I get this fat error.
Traceback (most recent call last):
File "setup.py", line 18, in <module>
setup_requires=['py2app'],
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.8_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 659, in run
self._run()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 865, in _run
self.run_normal()
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 959, in run_normal
self.create_binaries(py_files, pkgdirs, extensions, loader_files)
File "/usr/local/lib/python2.7/site-packages/py2app/build_app.py", line 1214, in create_binaries
platfiles = mm.run()
File "/usr/local/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 105, in run
mm.run_file(fn)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 84, in run_file
self.scan_node(m)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 110, in scan_node
m = self.load_file(filename, caller=node)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 93, in load_file
newname = self.locate(name, loader=caller)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOStandalone.py", line 23, in locate
newname = super(FilteredMachOGraph, self).locate(filename, loader)
File "/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py", line 49, in locate
loader=loader.filename)
TypeError: dyld_find() got an unexpected keyword argument 'loader'
Why is this happening? I've spend the last few hours trying to deploy. No luck with py2app, cx_freeze, etc.
Here is a workaround: edit the file MachOGraph.py which in your case is located there:
/usr/local/lib/python2.7/site-packages/macholib/MachOGraph.py
Search for the term loader=loader.filename) and replace it with loader_path=loader.filename)
Credits goes to David Goldenberg for its post on bitbucket.org. https://bitbucket.org/ronaldoussoren/py2app/issues/137/py2app-problems-using-enthought-python
Pillow was the problem. Py2Applet doesn't play nice with it. Got rid of Pillow, and all is well.