adamrehn / conan-ue4cli

Integrate third-party libraries into the Unreal Engine with Conan
https://docs.adamrehn.com/conan-ue4cli/
MIT License
87 stars 20 forks source link

[ue4 conan generate] 'create --profile' failed w/ exit code 1, ends with "no build step" and "no module named 'ue4cli'" #11

Closed nmetrock closed 3 years ago

nmetrock commented 3 years ago

hello. i'm working with

no major changes to any default locations, however when i compiled UE i accidentally named the directory UE4.26, without the underscore. as part of my debug attempts here, i changed it to the traditional UE_4.26 format, ran the Engine\Binaries\Win64\UnrealVersionSelector-Win64-Shipping.exe tool and updated my path with ue4 setroot, and when none of that worked i then reinstalled both ue4cli conan-ue4cli.

editor runs fine, i ran clean.bat and a fresh build and repeated the above steps just to make sure. hopefully not a newbie mistake somewhere.

thank you for your time

PS C:\Program Files\Epic Games\UE_4.26> ue4 conan generate
Using user-specified engine root: C:\PROGRA~1\EPICGA~1\UE_4.26
Removing the "ue4.26-Win64" Conan profile if it already exists...
Removing any previous versions of profile base packages...
Creating "ue4.26-Win64" Conan profile using autodetected settings...
Installing profile base packages...
Copying the "ue4.26-Win64" Conan profile into a new profile named "ue4"...
Retrieving thirdparty library list from UBT...
Removing any previous versions of generated wrapper packages for 4.26...
Generating and installing wrapper package for ADO...
Traceback (most recent call last):
  File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python39\Scripts\ue4.exe\__main__.py", line 7, in <module>
  File "c:\program files\python39\lib\site-packages\ue4cli\cli.py", line 222, in main
    SUPPORTED_COMMANDS[command]['action'](manager, args)
  File "c:\program files\python39\lib\site-packages\conan_ue4cli\main.py", line 48, in main
    SUBCOMMANDS[subcommand]['function'](manager, args[1:])
  File "c:\program files\python39\lib\site-packages\conan_ue4cli\commands\generate.py", line 175, in generate
    PackageManagement.generateWrapper(lib, template, delegates, tempDir, channel, profile)
  File "c:\program files\python39\lib\site-packages\conan_ue4cli\common\PackageManagement.py", line 26, in generateWrapper
    PackageManagement.install(packageDir, channel, profile)
  File "c:\program files\python39\lib\site-packages\conan_ue4cli\common\PackageManagement.py", line 16, in install
    return Utility.run(['conan', 'create', '.', 'adamrehn/' + channel, '--profile=' + profile] + args, cwd=packageDir)
  File "c:\program files\python39\lib\site-packages\conan_ue4cli\common\Utility.py", line 29, in run
    raise Exception(
Exception: child process ['conan', 'create', '.', 'adamrehn/4.26', '--profile=ue4.26-Win64'] failed with exit code 1
stdout: "Exporting package recipe
ADO/ue4@adamrehn/4.26: A new conanfile.py version was exported
ADO/ue4@adamrehn/4.26: Folder: C:\Users\natha\.conan\data\ADO\ue4\adamrehn\4.26\export
ADO/ue4@adamrehn/4.26: Exported revision: 209a58001a8f1f24b507b303dd4d1d00
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
UNREAL_ENGINE_VERSION=4.26
ADO/ue4@adamrehn/4.26: Forced build from source
Installing package: ADO/ue4@adamrehn/4.26
Requirements
    ADO/ue4@adamrehn/4.26 from local cache - Cache
    ue4lib/ue4@adamrehn/profile from local cache - Cache
Packages
    ADO/ue4@adamrehn/4.26:b21c67632d3dc13ff6d7c7432a489603c3302c9a - Build
    ue4lib/ue4@adamrehn/profile:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache

Installing (downloading, building) binaries...
ue4lib/ue4@adamrehn/profile: Already installed!
ADO/ue4@adamrehn/4.26: Configuring sources in C:\Users\natha\.conan\data\ADO\ue4\adamrehn\4.26\source
ADO/ue4@adamrehn/4.26: Copying sources to build folder
ADO/ue4@adamrehn/4.26: Building your package in C:\Users\natha\.conan\data\ADO\ue4\adamrehn\4.26\build\b21c67632d3dc13ff6d7c7432a489603c3302c9a
ADO/ue4@adamrehn/4.26: Generator txt created conanbuildinfo.txt
ADO/ue4@adamrehn/4.26: Calling build()
ADO/ue4@adamrehn/4.26: Package 'b21c67632d3dc13ff6d7c7432a489603c3302c9a' built
ADO/ue4@adamrehn/4.26: Build folder C:\Users\natha\.conan\data\ADO\ue4\adamrehn\4.26\build\b21c67632d3dc13ff6d7c7432a489603c3302c9a
ADO/ue4@adamrehn/4.26: Generated conaninfo.txt
ADO/ue4@adamrehn/4.26: Generated conanbuildinfo.txt
ADO/ue4@adamrehn/4.26: Generating the package
ADO/ue4@adamrehn/4.26: Package folder C:\Users\natha\.conan\data\ADO\ue4\adamrehn\4.26\package\b21c67632d3dc13ff6d7c7432a489603c3302c9a
ADO/ue4@adamrehn/4.26: Calling package()
"
stderr: "ADO/ue4@adamrehn/4.26: WARN: This conanfile has no build step
ERROR: ADO/ue4@adamrehn/4.26: Error in package() method, line 53
        from ue4lib import UE4Lib
        ModuleNotFoundError: No module named 'ue4cli'
"
PS C:\Program Files\Epic Games\UE_4.26>
adamrehn commented 3 years ago

The fact that the ue4cli module can't be found from inside a Conan recipe suggests that you have two separate Python installations on your system and that Conan is using a different Python installation than the one from which you've been running ue4cli and conan-ue4cli.

I can see from the log output that ue4cli and conan-ue4cli are being run using the Python installation in C:\Program Files\Python39, so the next step is to identify the Python installation that Conan is using. Could you please run the following command and paste the output here:

where conan
nmetrock commented 3 years ago

Looking at my Program list, I do have two copies of Python, 3.9 and 3.7, installed around the same time in January (about 2 weeks before I ran into this issue.)

Here's the output you requested:

C:\Users\natha>where conan

C:\Program Files\Conan\conan\conan.exe

C:\Program Files\Python39\Scripts\conan.exe

adamrehn commented 3 years ago

Ah, I see what's going on now. You've installed Conan using pip at some point (which has created that Python 3.9 entry at the bottom of the list), but you've also installed Conan using the standalone installer (either directly or through a package manager such as Chocolatey), which has created the entry at the top of the list that's taking precedence. The standalone installer for Conan actually bundles its own separate copy of Python, which means you technically have three Python installations on your system and the Conan executable that's getting invoked is using its bundled version. You'll need to uninstall the standalone version of Conan, which will allow the Python 3.9 version to get called and correctly interoperate with ue4cli.

nmetrock commented 3 years ago

oh wow, what a mess. thank you for helping me sort this out, I appreciate your time.