I have a virtual env and I am trying to install a private (my company's) package into it. I download the tar.gz file in the project repo and then I do pip install pkg_name --find-links=".". But every time I get this error:
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/49/76fpmgk16_149s5r58lk33040000gq/T/pip-install-7ui62a2g/tmprint_1d674d12ea874b83b3fa7ad42797d36d/setup.py", line 2, in <module>
import distutils.command.bdist_conda
ModuleNotFoundError: No module named 'distutils.command.bdist_conda'
I am using python=3.7.4 on macOs.
Any help is really appreciated.
I downloaded Pyro using source install instructions here under the Install from source link because I was always told not to use pip when installing to an Anaconda installation. When I try import pyro I get the attribute error below which does not make sense
import pyro
Traceback (most recent call last):
File "<ipython-input-48-05a8cb49cc0d>", line 1, in <module>
import pyro
File "C:\Users\bjwil\Anaconda3\Lib\site-packages\pyro\__init__.py", line 6, in <module>
from pyro.primitives import (clear_param_store, enable_validation, get_param_store, iarange, irange, module, param,
File "C:\Users\bjwil\Anaconda3\Lib\site-packages\pyro\primitives.py", line 10, in <module>
import pyro.infer as infer
File "C:\Users\bjwil\Anaconda3\Lib\site-packages\pyro\infer\__init__.py", line 14, in <module>
from pyro.infer.traceenum_elbo import JitTraceEnum_ELBO, TraceEnum_ELBO
File "C:\Users\bjwil\Anaconda3\Lib\site-packages\pyro\infer\traceenum_elbo.py", line 183, in <module>
class BackwardSampleMessenger(pyro.poutine.messenger.Messenger):
AttributeError: module 'pyro.poutine' has no attribute 'messenger'
This doesn't make much sense because in the poutine folder I have the messenger file and it has the Class Messenger so line 183 class BackwardSampleMessenger(pyro.poutine.messenger.Messenger) in the traceenum_elbo.py file should be working.
I'm struggling to get PYMC3 to install correctly on windows. I've tried using the Anaconda package via conda install -c conda-forge pymc3 and in a virtualenv using only pip as per the documentation.
It seems to install ok, but fails when running an import pymc3 with the following error. Research suggests that there may be some dependencies which are getting missed.
>>> import pymc3
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\__init__.py", line 8, in <module>
from .sampling import *
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\sampling.py", line 11, in <module>
from .step_methods import (NUTS, HamiltonianMC, Metropolis, BinaryMetropolis,
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\__init__.py", line 3, in <module>
from .hmc import HamiltonianMC
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\__init__.py", line 1, in <module>
from .hmc import HamiltonianMC
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\hmc.py", line 7, in <module>
from .base_hmc import BaseHMC
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\base_hmc.py", line 2, in <module>
from .trajectory import get_theano_hamiltonian_functions
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\step_methods\hmc\trajectory.py", line 3, in <module>
from pymc3.theanof import join_nonshared_inputs, gradient, CallableTensor, floatX
ImportError: cannot import name 'floatX'
I can't find much out there about this floatx package.
Seems to be a windows thing - as it installed and runs no problems on my old Ubuntu box (with anaconda).
Any help gratefully received!
EDIT: Step closer. For some reason I had the path to the nvcc compiler wrong. So if you suffer the same check that you have the full path including "\bin" in your environmnental path. If you make a change don't forget to restart.
Now I get an error:
>>> import pymc3
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
Using gpu device 0: GeForce GTX 960M (CNMeM is disabled, cuDNN not available)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\__init__.py", line 4, in <module>
from .distributions import *
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\__init__.py", line 1, in <module>
from . import timeseries
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\timeseries.py", line 1, in <module>
import theano.tensor as tt
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\__init__.py", line 116, in <module>
theano.sandbox.cuda.tests.test_driver.test_nvidia_driver1()
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\sandbox\cuda\tests\test_driver.py", line 32, in test_nvidia_driver1
profile=False)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\function.py", line 326, in function
output_keys=output_keys)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\pfunc.py", line 486, in pfunc
output_keys=output_keys)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 1795, in orig_function
defaults)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\compile\function_module.py", line 1661, in create
input_storage=input_storage_lists, storage_map=storage_map)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\link.py", line 699, in make_thunk
storage_map=storage_map)[:3]
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\vm.py", line 1098, in make_all
self.updated_vars,
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\vm.py", line 952, in make_vm
vm = CVM(
NameError: name 'CVM' is not defined
>>>
This I fixed with the last post here: https://groups.google.com/forum/#!msg/theano-users/JoTu61_MTLk/4ZzsVyaOf2kJ. But now stuck with an error:
>>> import pymc3
Traceback (most recent call last):
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 306, in <module>
from cutils_ext.cutils_ext import * # noqa
ImportError: No module named 'cutils_ext.cutils_ext'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 317, in <module>
from cutils_ext.cutils_ext import * # noqa
ImportError: No module named 'cutils_ext.cutils_ext'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\__init__.py", line 4, in <module>
from .distributions import *
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\__init__.py", line 1, in <module>
from . import timeseries
File "C:\Users\peter\Anaconda3\lib\site-packages\pymc3\distributions\timeseries.py", line 1, in <module>
import theano.tensor as tt
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\__init__.py", line 80, in <module>
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\scan_module\__init__.py", line 41, in <module>
from theano.scan_module import scan_opt
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\scan_module\scan_opt.py", line 60, in <module>
from theano import tensor, scalar
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\tensor\__init__.py", line 9, in <module>
from theano.tensor.subtensor import *
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\tensor\subtensor.py", line 26, in <module>
import theano.gof.cutils # needed to import cutils_ext
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 320, in <module>
compile_cutils()
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cutils.py", line 285, in compile_cutils
preargs=args)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 2313, in compile_str
return dlimport(lib_filename)
File "C:\Users\peter\Anaconda3\lib\site-packages\theano\gof\cmodule.py", line 302, in dlimport
rval = __import__(module_name, {}, {}, [module_name])
ImportError: DLL load failed: The specified procedure could not be found.
>>>
The investigation continues! Maybe it's time to bin windows and move to linux full time!
EDIT2: I switched to a python 2.7 environment and it seems to work ok. Had to install http://mingw.org/ but after that all ok.
Would be nice to get it to work in 3.6 though. Thoughts anyone?
Ok, I managed to cobble an install together.
I had no luck with the dependency management etc using conda install -c conda-forge pymc3, and I couldn't be sure if there were issues with locations/paths to compilers etc. So I did a re-install from the start.
I went for Anaconda3 (rather than 2) and it worked fine.
1) I followed the environment setup here https://github.com/philferriere/dlwin until I got to the point of installing Theano. But instead of the version suggested I installed the latest with conda install -c rdonnelly Theano suggested by https://github.com/nouiz. This is a nice solid environment set up - and i really recommend the msys tool - I hadn't used it before.
The test script in the philferriere guide are a good way to test function/performance.
2) Then I set up pymc3 using pip install pymc3 as they suggest here https://github.com/pymc-devs/pymc3. but NOT the latest version on git.
Hope someone finds this useful.
Refs:
https://github.com/Theano/Theano/issues/5348
I am testing some chatbots from Github, I seem to get the following error whenever I try running chatbots using tensorflow.
after typing python train.py
Traceback (most recent call last):
File "train.py", line 8, in <module>
from tf_seq2seq_chatbot.lib.train import train
File "C:\Users\S\Downloads\ChatBot-master\ChatBot-master\tf_seq2seq_chatbot\lib\train.py", line 14, in <module>
from tf_seq2seq_chatbot.lib.seq2seq_model_utils import create_model
File "C:\Users\S\Downloads\ChatBot-master\ChatBot-master\tf_seq2seq_chatbot\lib\seq2seq_model_utils.py", line 11, in <module>
from tf_seq2seq_chatbot.lib import seq2seq_model
File "C:\Users\S\Downloads\ChatBot-master\ChatBot-master\tf_seq2seq_chatbot\lib\seq2seq_model.py", line 28, in <module>
from tensorflow.models.rnn.translate import data_utils
ImportError: No module named 'tensorflow.models'
Source https://github.com/AhmedAbdalazeem/ChatBot
You need to install the tensorflow.models repository.
I've been using buildout for quite a while now without any issue, in fact I did yesterday without any problems.
But as today all my projects fail to buildout. I tried on two different Ubuntu workstations with the same result.
This is the error I get:
Initializing zc.buildout
Debug: Downloading http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
Traceback (most recent call last):
File "bootstrap.py", line 259, in <module>
import zc.buildout.buildout
File "/tmp/tmpNkVMXW/zc.buildout-2.0.0-py2.7.egg/zc/buildout/buildout.py", line 18, in <module>
import zc.buildout.easy_install
File "/tmp/tmpNkVMXW/zc.buildout-2.0.0-py2.7.egg/zc/buildout/easy_install.py", line 59, in <module>
pkg_resources.Requirement.parse('distribute')
AttributeError: 'NoneType' object has no attribute 'location'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
ImportError: No module named apport.fileutils
Original exception was:
Traceback (most recent call last):
File "bootstrap.py", line 259, in <module>
import zc.buildout.buildout
File "/tmp/tmpNkVMXW/zc.buildout-2.0.0-py2.7.egg/zc/buildout/buildout.py", line 18, in <module>
import zc.buildout.easy_install
File "/tmp/tmpNkVMXW/zc.buildout-2.0.0-py2.7.egg/zc/buildout/easy_install.py", line 59, in <module>
pkg_resources.Requirement.parse('distribute')
AttributeError: 'NoneType' object has no attribute 'location'
It complains that there's no module named apport.fileutils .. but I get no exception when I run python and import it:
from apport.fileutils import likely_packaged, get_recent_crashes
2.0.0 just got released. The old bootstrap.py is not compatible with 2.0.0 but downloads it by default. You can get the v2 bootstrap.py from here, or use the code below if you want to stick with the old version.
python bootstrap.py -v 1.7.0
edit: older versions of v1 bootstrap.py don't allow version forcing. The up-to-date version here does.
The question + answer is from 2013. I recently (2015) saw it happening again.
The problem is that ubuntu's python-apport package installs a /usr/lib/python2.7/dist-packages/apport_python_hook.py file that overrides sys.excepthook. It makes sure python tracebacks are fed into ubuntu's "apport" error reporting mechanism.
That in itself is not a problem. But bootstrap.py restricts the python path, so that the hook cannot import apport anymore...
So if an error occurs during the bootstrap run, an exception is printed which then fails a second time because apport cannot be imported.
A solution could be to sudo apt-get remove python-apport. That's at least what we did on the server (where having apport makes no sense in any case).