I can't get analytics output from tensorboard
pytorch version == 1.9.0,
tensorboard version == 2.6.0
Traceback (most recent call last):
File "optim.py", line 7, in <module>
from torch.utils.tensorboard import SummaryWriter
File "/root/miniconda3/envs/score-denoise/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py", line 4, in <module>
LooseVersion = distutils.version.LooseVersion
AttributeError: module 'distutils' has no attribute 'version'
I found a project that uses exactly these versions of libraries, installed them, but it didn't start working, how to solve this problem?
I found this link with a similar problem, but I didn't find a solution to it. https://github.com/pytorch/pytorch/issues/69894
What exactly did you do? Did you do this?
pip install setuptools==59.5.0
If yes, did the error change?
Related
I've developed a PyQT5 app that also uses Numpy, Pandas and Plotly. To package it up I decided to use Nuitka however since the product is for the end users who won't be familiar with Python, I want to make sure the interpreter is packaged up along with the app as a single binary (similar to PyInstaller).
I'm running the following command however have been getting errors that I'm struggling to figure out how to fix:
$ python -m nuitka --standalone --show-progress --recurse-all --plugin-enable=numpy main.py
I'm using PyCharm and all the libraries are in the Virtual Environment in project directory. The version of Python I'm using is 3.9.
An executable binary is generated in Windows however upon running I receive the following error message:
C:\Users\user\PycharmProjects\PlotlyExample\main.dist>main
Traceback (most recent call last):
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\__init__.py", line 22, in <module numpy.core>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\multiarray.py", line 12, in <module numpy.core.multiarray>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\overrides.py", line 7, in <module numpy.core.overrides>
ImportError: LoadLibraryExW 'C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\_multiarray_umath.pyd' failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\main.py", line 5, in <module>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\__init__.py", line 140, in <module numpy>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\__init__.py", line 48, in <module numpy.core>
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\python.exe"
* The NumPy version is: "1.19.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: LoadLibraryExW 'C:\Users\\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\_multiarray_umath.pyd' failed: The specified module could not be found.
Sample Code:
https://pastebin.com/RjRYUk0C
Any ideas? Thanks!
I have a source code read CAPTCHA. When i run test, I got a problem on Windows 10
Traceback (most recent call last):
File "train.py", line 48, in <module>
from object_detection.builders import dataset_builder
File "C:\Users\HuyHys\Anaconda3\lib\site-packages\object_detection\builders\dataset_builder.py", line 27, in <module>
from object_detection.data_decoders import tf_example_decoder
File "C:\Users\HuyHys\Anaconda3\lib\site-packages\object_detection\data_decoders\tf_example_decoder.py", line 27, in <module>
slim_example_decoder = tf.contrib.slim.tfexample_decoder
AttributeError: module 'tensorflow' has no attribute 'contrib'
I found a ask on stackoverflow (visit Module 'tensorflow' has no attribute 'contrib')
But i can't fix this error. Pls, anyone can help me!
How to fix detail this error???
This Error occurs because tf.contrib is removed from TensorFlow 2. I guess you are using old code from Tensorflow 1 that is not compatible with the new Tenserflow 2. For more information checkout Migrate your TensorFlow 1 code to TensorFlow 2. If you need more help please share all code snippets where you use tf.contrib.
I installed the Tensorflow(-gpu) version 1.8.0 as a pip package following these instructions. Upon installation, I opened a python3 console and typed in
import tensorflow as tf
Upon which,I get the following error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/px2/.local/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/px2/.local/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 47, in <module>
import numpy as np
File "/home/px2/.local/lib/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/home/px2/.local/lib/python3.5/site-packages/numpy/core/__init__.py", line 57, in <module>
from . import numerictypes as nt
File "/home/px2/.local/lib/python3.5/site-packages/numpy/core/numerictypes.py", line 111, in <module>
from ._type_aliases import (
File "/home/px2/.local/lib/python3.5/site-packages/numpy/core/_type_aliases.py", line 63, in <module>
_concrete_types = {v.type for k, v in _concrete_typeinfo.items()}
File "/home/px2/.local/lib/python3.5/site-packages/numpy/core/_type_aliases.py", line 63, in <setcomp>
_concrete_types = {v.type for k, v in _concrete_typeinfo.items()}
AttributeError: 'tuple' object has no attribute 'type'
A similar looking problem reported on StackOverflow has an answer that versions > 1.7 seems to not have this problem. But I seem to have it in 1.8
Can someone help me out?
In fact, this means you have multiple versions of numpy installed somehow (or there are multiple versions that are overlapping). You need to make sure that numpy is fully uninstalled from your system, then reinstall.
For me, I did
pip uninstall numpy
sudo apt-get purge python3-numpy
Then I had to go to /usr/local/lib/python3.6/dist-packages and delete the numpy folders that were still there for some reason. After that, reinstalling numpy with
pip install numpy
worked. Here is the github issue I opened on it:
https://github.com/numpy/numpy/issues/12775
Had the same issue, fixed by going back to Numpy 1.15.4
Thanks wordsforthewise
I can't help you but I can point out another thread with a similar issue: Error with calling Numpy, Scipy, Gensim in python3
This is slightly late, but for anyone running into this issue, what fixed it for me was going into my /anaconda3/lib/python3.X/site-packages folder and manually removing numpy there. Replace python3.X with you version of course.
I also followed Wordsforthewise' suggestion and ran his first two commands before reinstalling numpy via pip. I ran into this problem on a google cloud shell.
I have an error that only appears when running unittests inside of PyCharm.
Python 3.6.5 on OSX.
/Users/me/project/env/bin/python /Applications/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py --target test_module.TestClass.test_method
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py", line 4, in <module>
from unittest import main
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/__init__.py", line 58, in <module>
from .result import TestResult
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/result.py", line 5, in <module>
import traceback
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 5, in <module>
import linecache
File "/Users/enos/patrf/api/env/lib/python3.6/linecache.py", line 11, in <module>
import tokenize
File "/Users/enos/patrf/api/env/lib/python3.6/tokenize.py", line 33, in <module>
import re
File "/Users/enos/patrf/api/env/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
This error seems related to Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?
The suggestions there don't work here.
Adding enum-compat to requirements.txt doesn't change anything.
A trivial unit test .py file that imports nothing at all still shows this problem.
There are no enum.py files in my project directory.
Happens with a clean virtualenv and a clean venv.
Everything works fine outside of PyCharm.
This only appears to happen in the one project I have that uses Graphene, which does have an enum.py, but even deleting those files has no effect. find . -name "enum.py" returns nothing.
Any PyCharm experts have an idea? I really like to run my tests inside of PyCharm and I'd love to be able to do so for this project.
I ran into this issue as well. I was able to solve it by removing the enum34 package. Even if you're using venv you need to make sure that you check all directories that the PyCharm Project Interpreter is adding to the PYTHONPATH. Just running pip uninstall enum34 may not fix the issue.
In my case, I had PyCharm loading extra directories to the PYTHONPATH and the enum34 package was included in one of them. Removing it from that directory solved the issue.
My python version is 3.6. my OS is windows. After install rpy2 module, when I type import rpy2, got no issue. But when type import rpy2.ipython, got error as below:
>>> import rpy2.ipython
Warning (from warnings module):
File "D:\Soft_app\Python\lib\site-packages\rpy2\ipython\rmagic.py", line 76
"either.")))
UserWarning: The Python package 'pandas' is strongly recommended when using `rpy2.ipython`. Unfortunately it could not be loaded, and we did not manage to load 'numpy' either.
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
import rpy2.ipython
File "D:\Soft_app\Python\lib\site-packages\rpy2\ipython\__init__.py", line 1, in <module>
from .rmagic import load_ipython_extension
File "D:\Soft_app\Python\lib\site-packages\rpy2\ipython\rmagic.py", line 81, in <module>
from IPython.core.displaypub import publish_display_data
ModuleNotFoundError: No module named 'IPython'
Can help to figure out what's issue??
It seems that you are missing Ipython and pandas. Installing them should resolve your issue.
Run "pip install ipython" to install Ipython and run "pip install pandas" to install pandas.
Hopefully, this will solve your problem.
Happy Coding ~