Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

klibs export #6

Open
abidi-wq opened this issue Dec 5, 2022 · 10 comments
Open

klibs export #6

abidi-wq opened this issue Dec 5, 2022 · 10 comments

Comments

@abidi-wq
Copy link

abidi-wq commented Dec 5, 2022

Hello,

I have a little problem with klibs export function.
When I run klibs export, it display the following error :

C:\Users\wied\AppData\Local\Programs\Python\Python36\TaskSwitching_expe>klibs export

*** Exporting data from TaskSwitching ***

Local database: None
Traceback (most recent call last):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\Scripts\klibs-script.py", line 11, in
load_entry_point('KLibs==0.7.5a9', 'console_scripts', 'klibs')()
File "c:\users\wied\appdata\local\programs\python\python36\lib\site-packages\klibs_main_.py", line 182, in klibs_main
commandscmd
File "c:\users\wied\appdata\local\programs\python\python36\lib\site-packages\klibs\cli.py", line 399, in export
DatabaseManager().export(table, multi_file, join)
File "c:\users\wied\appdata\local\programs\python\python36\lib\site-packages\klibs\KLDatabase.py", line 477, in init
shutil.copy(P.database_path, P.database_local_path)
File "c:\users\wied\appdata\local\programs\python\python36\lib\shutil.py", line 239, in copy
if os.path.isdir(dst):
TypeError: _isdir: path should be string, bytes or os.PathLike, not NoneType

Best regards,
malek

@a-hurst
Copy link
Member

a-hurst commented Dec 5, 2022

Hi @abidi-wq, very strange error! Can you try updating to the latest release of KLibs? https://github.com/a-hurst/klibs/releases/tag/0.7.6b1

Hopefully that should fix the issue, and will at least give me a better starting point to begin debugging from.

@abidi-wq
Copy link
Author

abidi-wq commented Dec 6, 2022

Hi,

It doesn't work :(
Maybe because I have renamed the file (Taskswitching_expe)? I tried to run the function with another taskswitching file on the same computer and it work.
Can we recover the files/data of the subjects who have passed the experiment using taskswitching_expe file.

Best,
*** Exporting data from TaskSwitching ***

Traceback (most recent call last):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\Scripts\klibs-script.py", line 11, in
load_entry_point('KLibs==0.7.6b1', 'console_scripts', 'klibs')()
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs_main_.py", line 182, in klibs_main
commandscmd
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\cli.py", line 405, in export
DatabaseManager(P.database_path).export(table, multi_file, join)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 771, in export
if self._already_exported(p_id, table):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 643, in _already_exported
matches = self._primary.select('export_history', where=this_id)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 512, in select
self._ensure_table(table)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 341, in _ensure_table
raise ValueError(e.format(table))
ValueError: No table named 'export_history' in the current database

@abidi-wq
Copy link
Author

abidi-wq commented Dec 6, 2022

Sorry!! the klibs export function work before running the experiment however after the experiment it display the same message even with the other file (Taskswitching)

@a-hurst
Copy link
Member

a-hurst commented Dec 6, 2022

@abidi-wq Thanks for the error log, I'll take a look later today and see if I can figure it out!

@a-hurst
Copy link
Member

a-hurst commented Dec 7, 2022

@abidi-wq Okay, I think I fixed the issue! I made some changes to how the database works recently and accidentally broke export compatibility with older databases. I've tested and fixed this in the latest git version, which you can install with

pip install git+https://github.com/a-hurst/klibs.git

Let me know if that works!

@abidi-wq
Copy link
Author

Hi,

It still don't work :(

C:\Users\wied\AppData\Local\Programs\Python\Python36>pip install git+https://github.com/a-hurst/klibs.git
Collecting git+https://github.com/a-hurst/klibs.git
Cloning https://github.com/a-hurst/klibs.git to c:\users\wied\appdata\local\temp\pip-req-build-sq65s0ts
Running command git clone --filter=blob:none -q https://github.com/a-hurst/klibs.git 'C:\Users\wied\AppData\Local\Temp\pip-req-build-sq65s0ts'
Resolved https://github.com/a-hurst/klibs.git to commit 2a7430407fef71d6a9bb6df7365133ee62a4abe0
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.8.0rc1 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (1.19.5)
Requirement already satisfied: pysdl2>=0.9.7 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (0.9.14)
Requirement already satisfied: pysdl2-dll>=2.0.10 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (2.24.1)
Requirement already satisfied: Pillow!=5.1.0,>=3.0.0 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (8.4.0)
Requirement already satisfied: aggdraw>1.2.0 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (1.3.14)
Requirement already satisfied: PyOpenGL>=3.1.0 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (3.1.6)

C:\Users\wied\AppData\Local\Programs\Python\Python36\TaskSwitching_expe>klibs export

*** Exporting data from TaskSwitching ***

Traceback (most recent call last):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\Scripts\klibs-script.py", line 11, in
load_entry_point('KLibs==0.7.6b1', 'console_scripts', 'klibs')()
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs_main_.py", line 182, in klibs_main
commandscmd
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\cli.py", line 405, in export
DatabaseManager(P.database_path).export(table, multi_file, join)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 771, in export
if self._already_exported(p_id, table):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 643, in _already_exported
matches = self._primary.select('export_history', where=this_id)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 512, in select
self._ensure_table(table)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 341, in _ensure_table
raise ValueError(e.format(table))
ValueError: No table named 'export_history' in the current database

C:\Users\wied\AppData\Local\Programs\Python\Python36\TaskSwitching_expe>

@a-hurst
Copy link
Member

a-hurst commented Dec 13, 2022

Whoops, I messed up the update command! You're still running the version before the fix. Here's the correct update command (needs the -U to force an update):

pip install -U git+https://github.com/a-hurst/klibs.git

@abidi-wq
Copy link
Author

I runned the command but still don't work, it display the same error message.

C:\Users\wied\AppData\Local\Programs\Python\Python36>pip install -U git+https://github.com/a-hurst/klibs.git
Collecting git+https://github.com/a-hurst/klibs.git
Cloning https://github.com/a-hurst/klibs.git to c:\users\wied\appdata\local\temp\pip-req-build-ei37n40t
Running command git clone --filter=blob:none -q https://github.com/a-hurst/klibs.git 'C:\Users\wied\AppData\Local\Temp\pip-req-build-ei37n40t'
Resolved https://github.com/a-hurst/klibs.git to commit 2a7430407fef71d6a9bb6df7365133ee62a4abe0
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.8.0rc1 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (1.19.5)
Requirement already satisfied: pysdl2>=0.9.7 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (0.9.14)
Requirement already satisfied: pysdl2-dll>=2.0.10 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (2.24.1)
Requirement already satisfied: Pillow!=5.1.0,>=3.0.0 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (8.4.0)
Requirement already satisfied: aggdraw>1.2.0 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (1.3.14)
Requirement already satisfied: PyOpenGL>=3.1.0 in c:\users\wied\appdata\local\programs\python\python36\lib\site-packages (from KLibs==0.7.6b1) (3.1.6)

*** Exporting data from TaskSwitching ***

Traceback (most recent call last):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\Scripts\klibs-script.py", line 11, in
load_entry_point('KLibs==0.7.6b1', 'console_scripts', 'klibs')()
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs_main_.py", line 182, in klibs_main
commandscmd
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\cli.py", line 405, in export
DatabaseManager(P.database_path).export(table, multi_file, join)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 771, in export
if self._already_exported(p_id, table):
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 643, in _already_exported
matches = self._primary.select('export_history', where=this_id)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 512, in select
self._ensure_table(table)
File "C:\Users\wied\AppData\Local\Programs\Python\Python36\lib\site-packages\klibs\KLDatabase.py", line 341, in _ensure_table
raise ValueError(e.format(table))
ValueError: No table named 'export_history' in the current database

C:\Users\wied\AppData\Local\Programs\Python\Python36\TaskSwitching>

@a-hurst
Copy link
Member

a-hurst commented Dec 17, 2022

Huh, looks like it's still not updating properly: those line number should be different if you were running the latest code.

Can you try uninstalling klibs and then reinstalling it with the command above? Just pip uninstall klibs and then pip install -U git+https://github.com/a-hurst/klibs.git. No clue why your output says it's updating but the traceback shows it hasn't.

@abidi-wq
Copy link
Author

abidi-wq commented Jan 9, 2023

Hi Austin,

Many thanks, it work.

Best regards,
Malek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants