The issue is related to openpyxl import. More specifically, you will need to start PipTools and in addition install lxml package.ebrahim raeyat wrote: ↑Tue Dec 11, 2018 9:02 pmyes. in interactive python consol in FreeCAD type this:
Code: Select all
import pandas as pd df = pd.DataFrame() df.to_excel('/home/ebi/df1.xlsx')
Code: Select all
memoryview: a bytes-like object is required, not 'str'
Traceback (most recent call last):
File "<string>", line 66, in Initialize
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/Mod/OpenSCAD/OpenSCADUtils.py", line 78, in searchforopenscadexe
stdout,stderr = p1.communicate(ascript)
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/subprocess.py", line 843, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/subprocess.py", line 1499, in _communicate
input_view = memoryview(self._input)
No problem on Windows or Linux. Obviously the function communicate expects bytes instead of str objects. Can you test if replacingpeterl94 wrote: ↑Wed Jan 02, 2019 6:12 amAre you guys aware of this? Got this error first time testing a macOS py3 build:Code: Select all
memoryview: a bytes-like object is required, not 'str' Traceback (most recent call last): File "<string>", line 66, in Initialize File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/Mod/OpenSCAD/OpenSCADUtils.py", line 78, in searchforopenscadexe stdout,stderr = p1.communicate(ascript) File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/subprocess.py", line 843, in communicate stdout, stderr = self._communicate(input, endtime, timeout) File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/subprocess.py", line 1499, in _communicate input_view = memoryview(self._input)
Code: Select all
ascript = ('tell application "Finder"\n'
'POSIX path of (application file id "org.openscad.OpenSCAD"'
'as alias)\n'
'end tell')
Code: Select all
ascript = (b'tell application "Finder"\n'
'POSIX path of (application file id "org.openscad.OpenSCAD"'
'as alias)\n'
'end tell')
Thanks, that did fix it.
Code: Select all
Traceback (most recent call last):
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/Mod/Test/TestPythonSyntax.py", line 44, in testAll
test_python_syntax(mod_dir, self.whitelist)
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/Mod/Test/TestPythonSyntax.py", line 19, in test_python_syntax
ast.parse(py_file.read())
File "/Users/peter/FreeCAD/install/FreeCAD.app/Contents/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 204: ordinal not in range(128)
Code: Select all
diff --git a/src/Mod/Test/TestPythonSyntax.py b/src/Mod/Test/TestPythonSyntax.py
index f529c5e78..f30536689 100644
--- a/src/Mod/Test/TestPythonSyntax.py
+++ b/src/Mod/Test/TestPythonSyntax.py
@@ -11,7 +11,7 @@ def test_python_syntax(rootdir, whitelist=None):
for sub_dir, dirs, files in os.walk(rootdir):
for fn in files:
kargs = {}
- if sys.version_info.major > 3:
+ if sys.version_info.major >= 3:
kargs["encoding"] = "utf-8"
if (not fn in whitelist) and os.path.splitext(fn)[1] == '.py':
with open(os.path.join(sub_dir, fn), **kargs) as py_file:
Good catch! Just overlooked the ">". But no idea why there is no problem on other platforms.Found the problem. Not sure why it is not a problem for other platforms.