nc-userimporter icon indicating copy to clipboard operation
nc-userimporter copied to clipboard

The script doesn't run

Open bureau2crea opened this issue 2 years ago • 4 comments

Hi,

I installed Python 3.9 and all required dependencies, and nc-userimport. After, i configured the config file and the CSV File.

But when, i launch the script, it doesn"t work. I have the following lines :

MacBook-Pro-M1:nc-userimporter toto$ ~/Library/Python/3.9/bin/pyinstaller --onefile nc-userimporter.py 115 INFO: PyInstaller: 5.13.0 115 INFO: Python: 3.9.6 124 INFO: Platform: macOS-13.4.1-arm64-arm-64bit 125 INFO: wrote /Users/toto/nc-userimporter/nc-userimporter.spec 127 INFO: Extending PYTHONPATH with paths ['/Users/toto/nc-userimporter'] 219 INFO: checking Analysis 230 INFO: checking PYZ 234 INFO: EXE target arch: arm64 234 INFO: Code signing identity: None 235 INFO: checking PKG 236 INFO: Bootloader /Users/toto/Library/Python/3.9/lib/python/site-packages/PyInstaller/bootloader/Darwin-64bit/run 236 INFO: checking EXE MacBook-Pro-M1:nc-userimporter toto$

Can you help me ?

Thanks

bureau2crea avatar Aug 24 '23 11:08 bureau2crea

Hi, you don't have to build release packages to run the script. Just install the dependencies and run the .py script :-)

I added some lines to the wiki page: grafik

t-markmann avatar Aug 24 '23 13:08 t-markmann

Sorry for the incomprehension. I launched the script, but i have the following error : Traceback (most recent call last): File "/Users/toto/nc-userimporter/nc-userimporter.py", line 327, in next(readCSV, None) # skip the headers File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/codecs.py", line 714, in next return next(self.reader) File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/codecs.py", line 645, in next line = self.readline() File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/codecs.py", line 558, in readline data = self.read(readsize, firstline=True) File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/codecs.py", line 504, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e in position 0: invalid start byte

I don't know if it's on the CSV file or on another file. Sorry, i'm not a specialist of Python. Thanks by advance

bureau2crea avatar Aug 24 '23 13:08 bureau2crea

I just tested the script with this:

  • a minimal users.csv grafik
  • changed only the necessary in config.xml: grafik

It worked fine: grafik

Please provide more details about your config.xml (without passwords or real url) and about your users.csv. Maybe consider to use a linux PC with python or a Windows PC / VM and the pre-built package (then you don't have to deal with python).

t-markmann avatar Aug 24 '23 16:08 t-markmann

Actually, the issue comes from the accents in the first names. Is it possible to handle them or should I remove them ? Should I change the encoding or put special characters in a different format?

Thank you in advance for your assistance.

bureau2crea avatar Aug 24 '23 16:08 bureau2crea

Easiest way: remove them. The display names can be changed later in the Nextcloud by the users.

t-markmann avatar May 16 '24 07:05 t-markmann