Closed AndreaMonzini closed 3 years ago
i tried to look the code,maybe the problem is that the Linux path is " / " and not " \ " so the screenplain module is not installed correctly:
Referred to Blender_Screenwriter.py
line 542:
home_url = bpy.utils.script_path_user() + "\\addons\\"
Let me know if that solves it on Linux?
i changed
home_url = bpy.utils.script_path_user() + "\\addons\\"
to
home_url = bpy.utils.script_path_user() + "//addons//"
But same errors.
I cannot find Screenplain as downloaded or installed
If i manually download screenplain-0.8.0.zip
and copy the screenplain folder in the addon folder i have this error:
Traceback (most recent call last):
File "/home/linux/.config/blender/2.81/scripts/addons/Blender_Screenwriter.py", line 513, in execute
self.open_browser)
File "/home/linux/.config/blender/2.81/scripts/addons/Blender_Screenwriter.py", line 552, in screenplay_export
import screenplain.parsers.fountain as fountain
File "/home/linux/.config/blender/2.81/scripts/addons/screenplain/parsers/fountain.py", line 8, in <module>
from six import next
ModuleNotFoundError: No module named 'six'
location: <unknown location>:-1
location: <unknown location>:-1
I don't know anything about Linux, but you probably do not have to use double // when they are turning that way.
Copying it to the add-on folder is what the add-on does and it works on Windows. Well actually it's the same way fountain.py is used by the add-on.
Have you tried to Google that error? (I'm not at my computer right now)
A moment at the computer. Seems like you're missing a module called six.
It can be installed using these instructions, but of course installing six instead pycodestyle: https://github.com/tin2tin/Python_Stylechecker_for_Blender
For reference: https://pypi.org/project/six/
I was able to install pip and six, thank you.
But still not work, probably i have to check the right path for the installation.
Now is in
pip3 install six Requirement already satisfied: six in /usr/lib/python3/dist-packages (1.12.0)
i checked in library and i have installed Python 2.7, 3, 3.7 and 3.8. i need to investigate more.
It is using the Python which comes with Blender. So you must run the pip command in the console in the Blender Python folder:
Screenplain can also be installed this way, but I would be happy if you could find a way to get the BSW to do it on Linux.
Does the add-on work if you install screenplain with pip?
I installed screenplain with pip
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from screenplain) (1.12.0) Installing collected packages: screenplain Successfully installed screenplain-0.8.0
but still far for working
And installed from the Blender Python bin?
I am searching to installing it using Blender Python console, but in Linux is a bit different. i do not have a Python.exe in the blender Python folder so i am trying to run it with ./
Blender Pyhton does not recognise pip or pip3:
linux@pop-os:~$ '/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m' pip3 -m install screenplain /home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m: can't open file 'pip3': [Errno 2] No such file or directory
no luck for now:
linux@pop-os:~$ '/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m' -m pip install screenplain /home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m: No module named pip
Ah, try to download and place this file in the folder with the Blender python exe: https://bootstrap.pypa.io/get-pip.py
And then run it from the command line with python "get-pip.py"
Or else try the ensurepip etc. stuff from here: https://blender.stackexchange.com/questions/108283/how-to-load-external-modules-packages-into-blender-python/140343#140343
I just enabled ensurepip
linux@pop-os:~$ '/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m' -m ensurepip
Looking in links: /tmp/tmp1wqxim2q
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-19.0.3 setuptools-40.8.0
Finally Works! Many thanks!
For other Linux users the commands that worked for me:
Bingo! If you want to test the pdf output, you can search for pdf and find some commented out code in Blender_Screenwriter.py which just needs to be inserted to get it to become an export option. I suspect that it is also module related.
Could you do me a favour at use pip to uninstall screenplain again, and then try to install it with BSW.py and see it it succeds now? (Then you can install screenplain again afterwards)
Sure now is uninstalled.
linux@pop-os:~$ '/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m' -m pip uninstall screenplain Uninstalling screenplain-0.8.0: Would remove: /home/linux/.local/bin/screenplain /home/linux/.local/lib/python3.7/site-packages/screenplain-0.8.0.dist-info/* /home/linux/.local/lib/python3.7/site-packages/screenplain/* Proceed (y/n)? y Successfully uninstalled screenplain-0.8.0
But this the error when i try to export:
Traceback (most recent call last):
File "/home/linux/.config/blender/2.81/scripts/addons/Blender_Screenwriter.py", line 513, in execute
self.open_browser)
File "/home/linux/.config/blender/2.81/scripts/addons/Blender_Screenwriter.py", line 560, in screenplay_export
convert(screenplay, output, bare=False)
File "/home/linux/.local/lib/python3.7/site-packages/screenplain/export/html.py", line 185, in convert
File "/home/linux/.local/lib/python3.7/site-packages/screenplain/export/html.py", line 194, in convert_full
FileNotFoundError: [Errno 2] No such file or directory: '/home/linux/.local/lib/python3.7/site-packages/screenplain/export/default.css
`
So it is not looking in the addons folder for the screenplain files? But properly where it was installed with pip.
Hmmm... I hope we can find better way than using pip in the console, but if not, could you write how to do it on Linux, so we can put in on the main page?
I un-commented the PDF, saved, restarted blender, export but i do not see PDF export options:
To install screenplain using GNU/Linux with Blender Python i used 2 commands with the terminal:
1:
'/INSTALLED_BLENDER_PATH/2.81/python/bin/python3.7m' -m ensurepip
2:
'/INSTALLED_BLENDER_PATH/2.81/python/bin/python3.7m' -m pip install screenplain
You need to place the (pdf etc.) inbetween the html and the fdx stuff. in the following line.
NB. You'll need to install a different version of screenplain for pdf: https://github.com/vilcans/screenplain (which installs additional modules)
I installed 'screenplain[PDF]', thank you:
'/INSTALLED_BLENDER_PATH/2.81/python/bin/python3.7m' -m pip install 'screenplain[PDF]'
linux@pop-os:~$ '/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/bin/python3.7m' -m pip install 'screenplain[PDF]'
Requirement already satisfied: screenplain[PDF] in ./App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/lib/python3.7/site-packages (0.8.0)
Requirement already satisfied: six in ./App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/lib/python3.7/site-packages (from screenplain[PDF]) (1.13.0)
Collecting reportlab; extra == "pdf" (from screenplain[PDF])
Downloading https://files.pythonhosted.org/packages/c2/bb/7f93a025df23706cc2a8b89f53764accfd480da295c026a1fb815199ade9/reportlab-3.5.32-cp37-cp37m-manylinux1_x86_64.whl (2.6MB)
100% |████████████████████████████████| 2.6MB 1.2MB/s
Collecting pillow>=4.0.0 (from reportlab; extra == "pdf"->screenplain[PDF])
Downloading https://files.pythonhosted.org/packages/89/3e/31c2e5385d7588016c6f7ac552e81c3fff2bef4bc61b6f82f8177752405c/Pillow-6.2.1-cp37-cp37m-manylinux1_x86_64.whl (2.1MB)
100% |████████████████████████████████| 2.1MB 1.2MB/s
Installing collected packages: pillow, reportlab
Successfully installed pillow-6.2.1 reportlab-3.5.32
But i receive these errors after i export to PDF:
Traceback (most recent call last):
File "/home/linux/.config/blender/2.81/scripts/addons/Blender_Screenwriter.py", line 512, in execute
self.open_browser)
File "/home/linux/.config/blender/2.81/scripts/addons/Blender_Screenwriter.py", line 565, in screenplay_export
to_pdf(screenplay, output)
File "/home/linux/.local/lib/python3.7/site-packages/screenplain/export/pdf.py", line 277, in to_pdf
doc.build(story)
File "/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/lib/python3.7/site-packages/reportlab/platypus/doctemplate.py", line 1082, in build
self._endBuild()
File "/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/lib/python3.7/site-packages/reportlab/platypus/doctemplate.py", line 1017, in _endBuild
if getattr(self,'_doSave',1): self.canv.save()
File "/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/lib/python3.7/site-packages/reportlab/pdfgen/canvas.py", line 1244, in save
self._doc.SaveToFile(self._filename, self)
File "/home/linux/App/blender-2.81-0a0d735acd6e-linux-glibc217-x86_64/2.81/python/lib/python3.7/site-packages/reportlab/pdfbase/pdfdoc.py", line 222, in SaveToFile
f.write(data)
TypeError: string argument expected, got 'bytes'
iirc is that the same error I'm getting. Can you get pdf conversion to work using the command line(I couldn't)?
ok i exported to pdf from command line after installing screenplain in /usr/local/bin
linux@pop-os:~$ sudo pip3 install screenplain
Collecting screenplain
Downloading https://files.pythonhosted.org/packages/36/07/0948dda71c4663cf579fbeaf722ac42f61f93bcf46b183fcbef455b7c990/screenplain-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from screenplain) (1.12.0)
Installing collected packages: screenplain
Successfully installed screenplain-0.8.0
using screenplain from /usr/local/bin/screenplain
( not the screenplain module in Blender)
Avoid character like "&" in the .fountain name or the are errors
linux@pop-os:~$ screenplain --format pdf test.fountain test.pdf
:
i found similar error: https://github.com/vilcans/screenplain/issues/47
For reference on installing using PIP: https://developer.blender.org/T71420 Maybe Jacques' solution can be used for installing external modules like Screenplain, instead of the current solution which apparently fails on Linux?
I think that Jacques' solution could be very useful, i hope it is compatible with text editor too. Anyway i am using VSCodium when necessary:
This may have been fixed, but I'm not on Linux, so I can't test. Can anyone help me with this?
Hi, tested the export but there is an error about the module screenplain: Tested in 2.81 ( GNU/Linux)