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

TypeError: argument of type 'WindowsPath' is not iterable #32

Closed
yudhanjaya opened this issue Sep 7, 2022 · 5 comments
Closed

TypeError: argument of type 'WindowsPath' is not iterable #32

yudhanjaya opened this issue Sep 7, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@yudhanjaya
Copy link

yudhanjaya commented Sep 7, 2022

I seem to be having an issue loading the bitsandbytes library in Windows (works on Collab without issue). EDIT: not sure if bitsandbytes alone or something else: apologies if this is unrelated.

Error message:

Traceback (most recent call last):
  File "C:\Users\User\text-gen\alt2.py", line 4, in <module>
    import bitsandbytes
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\__init__.py", line 6, in <module>
    from .autograd._functions import (
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\autograd\_functions.py", line 4, in <module>
    import bitsandbytes.functional as F
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\functional.py", line 14, in <module>
    from .cextension import COMPILED_WITH_CUDA, lib
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\cextension.py", line 41, in <module>
    lib = CUDALibrary_Singleton.get_instance().lib
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\cextension.py", line 37, in get_instance
    cls._instance.initialize()
  File "C:\Users\User\text-gen\textenv\lib\site-packages\bitsandbytes\cextension.py", line 31, in initialize
    self.lib = ct.cdll.LoadLibrary(binary_path)
  File "E:\Anaconda\lib\ctypes\__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
  File "E:\Anaconda\lib\ctypes\__init__.py", line 364, in __init__
    if '/' in name or '\\' in name:
TypeError: argument of type 'WindowsPath' is not iterable

A search around the issue gave me this: https://bugs.python.org/issue39243
The code that I'm trying to run is essentially trying to get the hivemind gpt-j 8-bit model running on my 1080ti (again, works in Collab).


UPDATE: 
Same issue even with a fresh install and simply attempting to loading the library

(base) C:\Users\User\text-gen>pip install git+https://github.com/TimDettmers/bitsandbytes
Collecting git+https://github.com/TimDettmers/bitsandbytes
Cloning https://github.com/TimDettmers/bitsandbytes to c:\users\user\appdata\local\temp\pip-req-build-vh0wtmvn
Running command git clone --filter=blob:none --quiet https://github.com/TimDettmers/bitsandbytes 'C:\Users\User\AppData\Local\Temp\pip-req-build-vh0wtmvn'
Resolved https://github.com/TimDettmers/bitsandbytes to commit f0ae860
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done

(base) C:\Users\User\text-gen>python
Python 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.

import bitsandbytes

===================================BUG REPORT===================================
Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues
For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link

WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('E')}
E:\Anaconda\lib\site-packages\bitsandbytes\cuda_setup\paths.py:98: UserWarning: E:\Anaconda did not contain libcudart.so as expected! Searching further paths...
warn(
WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/SteamLibrary/steamapps/common/Besiege/Besiege_Data/Managed'), WindowsPath('F')}
WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/SteamLibrary/steamapps/common/Besiege/Besiege_Data/Managed'), WindowsPath('F')}
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching /usr/local/cuda/lib64...
WARNING: The following directories listed in your path were found to be non-existent: {WindowsPath('/usr/local/cuda/lib64')}
WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!
CUDA SETUP: Loading binary E:\Anaconda\lib\site-packages\bitsandbytes\libbitsandbytes_cpu.so...
Traceback (most recent call last):
File "", line 1, in
File "E:\Anaconda\lib\site-packages\bitsandbytes_init_.py", line 6, in
from .autograd._functions import (
File "E:\Anaconda\lib\site-packages\bitsandbytes\autograd_functions.py", line 4, in
import bitsandbytes.functional as F
File "E:\Anaconda\lib\site-packages\bitsandbytes\functional.py", line 14, in
from .cextension import COMPILED_WITH_CUDA, lib
File "E:\Anaconda\lib\site-packages\bitsandbytes\cextension.py", line 41, in
lib = CUDALibrary_Singleton.get_instance().lib
File "E:\Anaconda\lib\site-packages\bitsandbytes\cextension.py", line 37, in get_instance
cls.instance.initialize()
File "E:\Anaconda\lib\site-packages\bitsandbytes\cextension.py", line 31, in initialize
self.lib = ct.cdll.LoadLibrary(binary_path)
File "E:\Anaconda\lib\ctypes_init
.py", line 460, in LoadLibrary
return self.dlltype(name)
File "E:\Anaconda\lib\ctypes_init
.py", line 364, in init
if '/' in name or '\' in name:
TypeError: argument of type 'WindowsPath' is not iterable

@tomaarsen
Copy link
Contributor

tomaarsen commented Sep 15, 2022

See #15 for a similar issue. In short, this work relies on libcudart.so and libcuda.so, which are only really usable on Linux.
With other words, there is currently no Windows support. See also #30 on the topic of Windows support.

Perhaps this should be clarified briefly in the README somewhere? @TimDettmers

@TimDettmers
Copy link
Collaborator

Thanks for the reply @tomaarsen. Yes, the documentation on this is a bit lagging and it might be better to add this to the readme. I will add it with CUDA 11.8 support.

@TimDettmers TimDettmers added enhancement New feature or request documentation Improvements or additions to documentation labels Oct 10, 2022
TimDettmers added a commit that referenced this issue Oct 10, 2022
Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

@rajasblack
Copy link

Thanks for the reply @tomaarsen. Yes, the documentation on this is a bit lagging and it might be better to add this to the readme. I will add it with CUDA 11.8 support.

Please update the README so that it will be useful for folks trying on Windows?

@Titus-von-Koeller
Copy link
Collaborator

@rajasblack Windows currently needs compilation from source as described here

There's currently a lot of work done on that front and things are still in flux. But installing from source things should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants