ml-stable-diffusion icon indicating copy to clipboard operation
ml-stable-diffusion copied to clipboard

no such module 'PackageDescription'

Open spaceexperiment opened this issue 3 years ago • 4 comments

I have Apple Swift version 5.7.2, xcode-select version 2396. and Ventura 13.1

when I run swift run StableDiffusionSample "a photo of an astronaut riding a horse on mars" --resource-path models/coreml-stable-diffusion-v1-4_original_compiled --seed 93 --output-path /Users/jibril/stablediffusion/output I get this error

.../Package.swift:4:8: error: no such module 'PackageDescription'
import PackageDescription

spaceexperiment avatar Dec 16 '22 18:12 spaceexperiment

I think the --resource-path argument here is looking for the Resources directory which would have been created during the previous conversion step. This is easy to overlook in the readme, I did the same thing at first. If you re-run the conversion step with the --bundle-resources-for-swift-cli enabled, it should work.

mjankowski avatar Dec 19 '22 15:12 mjankowski

I have the same issue. And --bundle-resources-for-swift-cli didn't fix the problem

khakimjanovich avatar Feb 09 '23 00:02 khakimjanovich

The following command fixed it for me: sudo xcode-select --switch /Applications/Xcode.app The problem was that xcode-select --print-path pointed to "CLI tools" instead of pointing to "Xcode.app". As described here: https://forums.kodeco.com/t/server-error-no-such-module-packagedescription/177438

mextex avatar Feb 23 '23 21:02 mextex

I came across this error: error: no such module 'PackageDescription' import PackageDescription with a different package I was using. Using: sudo xcode-select --switch /Applications/Xcode.app worked for me.

RucktFinity avatar Mar 15 '23 15:03 RucktFinity