UPDATE june 18:
I would like compiling my python code for windows.
I use to work with pyinstaller, python 3.5+, windows 7 and anaconda to control modules pandas, pyqt (v5) and pyqtgraph, but it seems something is not compatible. I would not be surprised if you tell me to change a version.
In previous versions, it worked with python 3.5, windows 7 and Pyinstaller 3.3.1- without pandas; the new version imports pandas and then this doesn’t work anymore:
with the usual config pyinstaller gives a message saying the C libraries are not built. Following the instructions, I should run python setup.py build_ext --inplace --force, except I don’t see the setup.py file, so I don’t know what to do. Forums tell me it should be a problem with pip but not with conda… but I use conda…
with python 3.6, I got an error message ‘RecursionError: maximum recursion depth exceeded’ (https://github.com/steph2016/profiles/blob/master/errorMessage). This problem seems known and solutions I found on forums is either to downgrade python or to replace my PyInstaller-3.3.1 by PyInstaller-3.4.dev0+7b3143612. But with PyInstaller-3.4.dev0+7b3143612 I get a ’’str’ object has no attribute ‘items’’ error (https://github.com/steph2016/profiles/blob/master/ErrorMessage2). I’m not sure pyinstaller is compatible with python 3.6…
with python 3.4, I got an error similar to the ‘str object’ one above. I’m not sure python3.4 is compatible with qt5…
I would be pleased by any solution with any version of whatever to windows-compile my code
I don't know if it is the issue but I didn't find PyQtGraph in Supported-Packages
I eventually applied the first solution proposed in No module named 'pandas._libs.tslibs.timedeltas' in PyInstaller in the original config (python 3.5, PyInstaller 3.3.1, pyqtgraph, pandas, windows 7,...) and it worked.
I don't know why adding def get_pandas_path ..... a.binaries) helps, so I can't justify. But just to be explicit even if it seems obvious: pyinstaller must be run on the spec file, not on the py one (for instance > pyinstaller toto.spec)
Related
I want to install PyMesh on a Windows 10 PC, if possible it should be installed in the side-packages of an interpreter delivered with the IDE we use.
I tried the way to run the setup discribed here
https://pymesh.readthedocs.io/en/latest/installation.html
so the part :
git clone https://github.com/PyMesh/PyMesh.git
cd PyMesh
git submodule update --init
worked without any problems.
I am not sure on windows if I now just can write
set PYMESH_PATH = path
and if i can use the path "...\PyMesh\PyMesh" here?
so i left out this part
I installed numpy and scipy (allready installed)
and nose because it is mentioned in the requirements.txt.
So my numpy scipy and nose versions are
numpy 1.19.1
scipy 1.6.0
nose 1.3.7 (same as requirenments)
and just run the setup.py with admin rights
python .\setup.py install
which also seemed to work but i got an error trying
python -c "import pymesh; pymesh.test()"
from the PyMesh folder
saying ModuleNotFoundError: No module named 'PyMesh'
or if i go up one Folder doing the same
saying AttributeError: module 'PyMesh' has no attribute 'triangle'
I found this link ImportError: No module named PyMesh
but i just dont know what i should type in there
I tried to install via pip by using pip install pymesh
but pip Installer gives me a different library.
So i tried in the docker version and in docker i tried the pymesh.load_mesh method with an stl File
but got
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I dont know if this is just the stl format (expecting binary getting ascii or vice versa)
The stl file itself can be opened so shouldnt be corrupted.
So is there a different way to install pymesh? A wheel would be great. Is it possible to install pymesh to the side-packages of a given Interpreter? Did someone else allready had the same error in Docker and knows the issue
thank you for your help
1st, the Disclaimer: I looked at numerous questions here, there is question about uninstalling all pip–installed, uninstalling matplotlib, moving to 3.5 from 2.7, –– but I didn't find an answer to my specific problem. Sorry if I didn't look hard enough.
Basically, my problem is I have a mess of different packages installed by different means at different times. Manifestations of this are:
1) I can import numpy from python but not from Jupyter notebook:
------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-5a0bd626bb1d> in <module>()
----> 1 import numpy
ImportError: No module named numpy
2) I cannot import nltk:
...
File "numpy.pxd", line 155, in init sklearn.utils.murmurhash (sklearn/utils/murmurhash.c:5029)
ValueError: numpy.dtype has the wrong size, try recompiling
likely many more.
I recently uninstalled jupyter and anaconda, installed anaconda again, - this didn't help.
I cannot uninstall numpy / scipy , although I can use them (?!?):
>:~%python -c 'from numpy.random import rand; print rand()'
0.946167984715
>:~%pip uninstall numpy
Cannot uninstall requirement numpy, not installed
I have two versions of Python:
2.7.11 under /usr/local/bin/ pointing to /usr/local/Cellar/python/2.7.11/bin/python
2.7.10 under /usr/bin/ pointing to
/System/Library/Frameworks/Python.framework/Versions
-- although the default is 2.7.10 (numpy works with it), and I think 2.7.11 was added by Anaconda (incorrectly, because it doesn't see numpy).
Yesterday I uninstalled everything I could think of, then upgraded to a new version of Mac OS (10.12.2 Sierra), and then re-installed anaconda – in vain.
I am close to reformatting the disk and starting from scratch.
Is there a better option?
Thank you! and sorry for so many details.
Not sure exactly on a MAC but these are the things to try on windows and it is probably similar on MAC.
Start with a clean install of anaconda then try "where python" and "where jupyter" (it is "which" instead of "where" on linux). This tells you where it is looking for the executables. Both should be subfolders of anaconda. If they are not check your PATH variable.
Now start python or jupyter; import sys and try sys.path. That tells you where python is looking for stuff. It should look only in anaconda sub folders.
I am running Python 3.5 on Windows 8. I am trying to install pygame. I downloaded and ran
pygame-1.9.2a0.win32-py3.2.msi (6.4 Mb)
from
http://www.pygame.org/download.shtml
From python I get, after starting a new session:
>>> import pygame
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import pygame
ImportError: No module named 'pygame'
How do I install? Was my PythonPath updated? Looking at sys.path, it doesn't look like it. How do I get Python to see the library? Where was the library installed? Thanks for the help.
Update1:
The first step i the pygame intsaller states "Select Python Installations - Select the locations where pygame-1.9.2a0 should be installed." Underneath that is a selection that states "Python from another location". This doesn't make sense to me. Anyone?
Update2: I solved the problem - I reinstalled python in the default location (it wasn't before). The pygame installer doesn't seem to support custom installations. Ok, fixed. Thanks all for the help.
Up to now, Windows binaries must match the Python binaries. ...py-3.2.msi is for 3.2 and will not work with 3.5. Either get a 3.5 binary from the site you already used or use pip to install pygame-1.9.2a0-cp35-none-win32.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ Use pip install /? to get info on how to install from somewhere other than pypi. It might be easier to download the file to your machine first. The site above says a bit about this.
Make sure you have 32-bit python and pygame.
Hello stack community!
I'm not sure if my question is graph-tool related or gtk-related, but maybe both. Moreover, sorry if what I did while trying to solve it is plain stupid, I'm not a programmer by formal education, so I know just as much as I could find by google and comprehend.
Here is the problem:
After I brew install graph-tool, launch python and try to import graph_tool.all I get the following error:
/usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.py:1318: RuntimeWarning: Error importing Gtk module: No module named repository; GTK+ drawing will not work.
Previously I was sure that if import pygtk; pygtk.require('2.0'); import gtk works, that means the error is a graph-tool issue, but that don't have to be the case since graph-tool might use gtk (3??) and GObject (right?) and the upper checks for gtk2 and pygtk ( This question led me to this thought ).
I tried reinstalling gtk, GObject and all dependencies. Wipe all brew-related and brew itself and then reinstall everything (as in here). Still same error appears. I also tried to unlink everything from brew and link it again just to be sure, but this does not change anything either.
What else did I check:
I'm running MAC OS X Version 10.10.3, homebrew-installed python 2.7.10 (python --version returns Python 2.7.10 which is the one installed by brew; which python points to /usr/local/bin/python). brew info graph-tool shows that all requirements of it are there (even the optional ones). GTK 2.24.28, GTK+3 3.16.4, PyGobject 2.28.6, GObject-introspection 2.28.6, Cairo 1.14.2, Py2Cairo 1.10.0, pango 1.36.8, XQuartz 2.7.7 etc are installed, dependencies of those are fine as well. gi 1.2 is installed (via pip), gi.repository is indeed not there. I am aware of this question, but I have PyGObjects installed.
I also read this question and the reply, but none of this solves my problem as far as I can judge.
I've spend two days looking for the solution, so any help is appreciated.
It's seem to be a cairo dependency issue.
As you may see here, graph-tool package require a lot of depencies (numpy, gfortran, scipy, freetype, libpng, matplotlib, boost, cgal, graphviz, cairo, cairomm, py2cairo)
In your case you may probably solve the issue with a clean reinstall of "cairo".
Try those commands:
brew install cairo
brew install cairomm
brew install py2cairo
If "brew" ask you to run command or install other packages, do it !
(We assume here that "brew" is properly installed)
Best regards
I've faced the same issue (with a slight difference on the line number):
>>> from graph_tool.all import *
/usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.py:1499: RuntimeWarning: Error importing Gtk module: No module named gi; GTK+ drawing will not work.
warnings.warn(msg, RuntimeWarning)
I know it's a relatively old question but wanted to share how I did it. You said you tried reinstalling GObject, but that is what made it work here.
I followed the installing instructions
brew install pygobject3 --with-python#2 gtk+3
which said gtk+3 and pygobject3 were already installed. Then I ran:
brew reinstall gtk+3
and
brew upgrade pygobject3
which made the import work.
I am using Python 2.7 through Anaconda 2.7.8 and need Kapteyn 2.2 to perform Non-linear Least Squares fitting easily (it is probably an alternative to Scipy.optimize.leastsq() for dummies like me!).
After copy-pasting this from a previous post here on Stack Overflow:
conda install -c https://conda.binstar.org/dhirschfeld pyodbc
and then running on my cmd (as I did not have pyodbc installed I think, because of which maybe the command prompt on my Windows 7 64-bit system was not responding well to python setup.py install inside the Anaconda directory where I unzipped the Kapteyn .zip file downloaded from University of Groningen website.
But, after the installing pyodbc properly and running python setup.py install, the cmd gave me an error saying error: command 'C:\Users\windows 7\Anaconda\Scripts\gcc.bat' failed with exit status 1. Later, when I tried to import kmpfit module (needed for Non-linear least square fitting with Kapteyn), here is the problem:
import kapteyn
help(kapteyn)
Help on package kapteyn:
NAME
kapteyn - Kapteyn package.
FILE
c:\users\windows 7\anaconda\kapteyn\__init__.py
PACKAGE CONTENTS
_ni_support
celestial
doccer
filters
interpolation
maputils
mplutil
positions
rulers
shapes
tabarray
wcsgrat
DATA
__all__ = ['celestial', 'wcs', 'wcsgrat', 'tabarray', 'maputils', 'mpl...
__version__ = '2.2'
VERSION
2.2
As you can see, there is no module named kmpfit (or even wcs) here. But according to http://www.astro.rug.nl/software/kapteyn/intro.html, these two should be there.
Kindly help. I have never imported any module before.
Thanks in advance...:-)
I just managed to get this working (on Mac OSX, so you may have to adjust this). My steps were:
$ conda install pyodbc (didn't need to go through binstar)
Download & unarchive the kapteyn package, then navigate to its directory
$ python setup.py install, which used my OS's C compiler and Anaconda's python, and installed kapteyn to my anaconda distro's site-packages, as it should.
Check that kmpfit.so is in the kapteyn folder in site-packages, showing that kmpfit installed correctly.
>> from kapteyn import kmpfit failed, ImportError: cannot import name kmpfit. I did some digging and discovered that it was still importing kapteyn from the folder that I downloaded, not from site-packages.
Delete the downloaded kapteyn folder, then try again. It worked!